我一直在抨击我的头agains简单的东西..php imagerotate()废除png上的阿尔法?
// ....all prev code is fine....
$pasteboard =imagecreatetruecolor($imgs['bg']["width"],$imgs['bg']["height"]);
imagealphablending($pasteboard, false);
imagecopyresampled($pasteboard, $imgs['bg']["img"],0,0,0,0,$imgs['bg']["width"],$imgs['bg']["width"],imagesx($imgs['bg']["img"]),imagesy($imgs['bg']["img"]));
imagecopyresampled($pasteboard, $imgs['photo']["img"],20,20,0,0,$imgs['photo']["width"],$imgs['photo']["width"],imagesx($imgs['photo']["img"]),imagesy($imgs['photo']["img"]));
imagesavealpha($pasteboard,true);
//send it out
$out = $pasteboard;
header('Content-type: image/png');
imagepng($out);
//then garbage collection
给了我这样的:
HORAY!
完美阿尔法png格式复合...
现在我想将它旋转,这样,而不是从$ = $纸板我这样做:
imagesavealpha($pasteboard,true);
//rotate it
$out = imagerotate($pasteboard,5,imagecolorexactalpha($pasteboard,255,255,255,50),0);
header('Content-type: image/png');
imagepng($out);
这可悲的是给了我这个:
BOOOO!
香港专业教育学院尝试设置颜色,如:
imagerotate($pasteboard,5,0x00000000,0);
也是最后ATTR,如:采样等等等等
imagerotate($pasteboard,5,0x00000000,1);
新的空图像...
没有骰子....
任何人都可以帮忙吗?
尝试旋转它,然后再调用'imagesavealpha' – Musa
谢谢@Musa也试过.. ..! – Alex
ignore_transparent(第四个参数)仅在PHP 5.1中添加。用'echo phpversion();检查你使用的是什么版本的PHP;' – xconspirisist