Canman2005 Posted June 13, 2006 Share Posted June 13, 2006 Hi allI have the following script which takes an image and rotates it,[code]$filename = 'images/help.jpg';$degrees = 350;$source = imagecreatefromjpeg($filename);imagecolortransparent($source,imagecolorat($source,0,0)); $rotate = imagerotate($source, $degrees, 0);$quality=100;$image = imagejpeg($rotate,"",$quality);[/code]The problem is that im left with a black background and I cannot seem to turn the background transparent.Can anyone help?Thanks in advanceEd Link to comment https://forums.phpfreaks.com/topic/11826-php-image-rotation-question/ Share on other sites More sharing options...
poirot Posted June 13, 2006 Share Posted June 13, 2006 imagerotate()'s third parameter defines the background color:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]resource imagerotate ( resource src_im, float angle, int bgd_color )[/quote][a href=\"http://www.php.net/imagerotate\" target=\"_blank\"]http://www.php.net/imagerotate[/a] Link to comment https://forums.phpfreaks.com/topic/11826-php-image-rotation-question/#findComment-44805 Share on other sites More sharing options...
Canman2005 Posted June 13, 2006 Author Share Posted June 13, 2006 Hiso what background value keeps it transparent?Thanks Link to comment https://forums.phpfreaks.com/topic/11826-php-image-rotation-question/#findComment-44813 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.