我正在构建一种只从其他图像创建动态图像的系统。我使用:imagecreatefromstring(file_get_contents("clown_avatar.png"));
创建图像并成功输出;但是,它会弄脏透明区域上的所有颜色。如何从透明图像创建图像损坏颜色?
查看原图:
而且,这里是从PHP文件中的结果:
这里是源,只需几行:
<?php
$im = imagecreatefromstring(file_get_contents("clown_avatar.png"));
//$bg = imagecolorallocate($im,0,0,0); doesn't effect
Header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
我试过加背景颜色与imagecolorallocate
;但它根本没有效果。
请发表您的源代码 – Frunsi 2009-12-28 12:44:39
包括的问题:) – 2009-12-28 14:27:27