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 Link to comment https://forums.phpfreaks.com/topic/184427-imagecreatefrompng-looses-transparency/ 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. Link to comment https://forums.phpfreaks.com/topic/184427-imagecreatefrompng-looses-transparency/#findComment-973541 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 Link to comment https://forums.phpfreaks.com/topic/184427-imagecreatefrompng-looses-transparency/#findComment-973558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.