note 39723 rejected from function.imagerotate by irchtml
| From: | irchtml@php.net | Date: | Mon, 09 Feb 2004 00:11:09 +0000 |
| Subject: | note 39723 rejected from function.imagerotate by irchtml | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64850@lists.php.net to get a copy of this message | ||
Note Submitter: electron@balticom.lv
----
Alpha crashes and in output is black within rotated image's bounding box, independent from
color value used in $transpared, image's original alpha is replaced with black. Is there any
solution???????
$bkg_img = imagecreatefromjpeg("back.jpg");
$out_img = imagecreatetruecolor($imageout_w,$imageout_h);
imagealphablending($out_img, true);
$bkg_w = imagesx($bkg_img);
$bkg_h = imagesy($bkg_img);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $imageout_w, $imageout_h, $bkg_w, $bkg_h);
$blend = imagecreatefrompng("something.png");
$transpared_color = imagecolorallocatealpha($blend , 0, 0, 0, 127);
$rotated = imagerotate($blend , $rotation, $transpared);
$blend_w = imagesx($rotated);
$blend_h = imagesy($rotated);
ImageCopy($out_img, $rotated, $xpos, $ypos, 0, 0, blend_w, $blend_h);
ImageJPEG($out_img, "out.jpg" , $quality);
imagedestroy($blend);
imagedestroy($rotated);
imagedestroy($src_img);
imagedestroy($dst_img);