【发布时间】:2011-10-10 03:45:31
【问题描述】:
我尝试复制具有投影(即 Alpha 通道)和透明背景的 PNG 图像。但是,生成的图像用黑色绘制阴影和透明背景。我试过imagecopy和imagecopymerge;两者都没有产生有效的结果,这与原始图像不同。
$src = imagecreatefrompng('img_box3-bg.png');
/* Using imagecopy. */
$dest = imagecreatetruecolor(116, 100);
imagecopy($dest, $src, 0, 0, 0, 0, 116, 100);
imagepng($dest, 'img_box3-bg.imagecopy.png');
imagedestroy($dest);
/* Using imagecopymerge. */
$dest2 = imagecreatetruecolor(116, 100);
imagecopymerge($dest2, $src, 0, 0, 0, 0, 116, 100, 100);
imagepng($dest2, 'img_box3-bg.imagecopymerge.png');
imagedestroy($dest2);
imagedestroy($src);
帮助?先谢谢了。
【问题讨论】:
标签: php image-processing image-manipulation