lynxus Posted December 8, 2009 Share Posted December 8, 2009 Hi Guys, I have a script that will display an image based on what the user selected in a DB. so for instance. a user will have <img src="http://blaa.com/image.php?siteid=1234"> Now my image.php will <? // do lost of other error checking etc // add their ip and time to a DB for visitor tracking. // now show the user a image $style = $_GET['siteid']; $image = imagecreatefrompng('http://status.imsupporting.com/'.$style.'off.png'); } } // and now... we display the image imagepng($image); imagedestroy($image); ?> this doesn't preserve the transparency , Is there a better way to do all this? -G Quote Link to comment Share on other sites More sharing options...
abazoskib Posted December 8, 2009 Share Posted December 8, 2009 http://php.net/manual/en/function.imagecreatefrompng.php the first user comment may help. Quote Link to comment Share on other sites More sharing options...
lynxus Posted December 8, 2009 Author Share Posted December 8, 2009 Good stuff thanks all i did was add imagealphablending($image, true); // setting alpha blending on imagesavealpha($image, true); // save alphablending setting (important) just above imagepng($image); imagedestroy($image); Thanks G Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.