note 39723 added to function.imagerotate
| From: | electron at balticom dot lv | Date: | Sun, 08 Feb 2004 23:06:25 +0000 |
| Subject: | note 39723 added to function.imagerotate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64845@lists.php.net to get a copy of this message | ||
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);
----
Manual Page -- http://www.php.net/manual/en/function.imagerotate.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39723
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39723&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39723&report=yes
Search -- http://master.php.net/manage/user-notes.php