2010-02-22 81 views
1

注知道我做错了这里...但我尝试过3个合并成PNG图像之一,它抛出一个错误PHP:试图合并多个PNG图片一起收到错误

警告:imagepng() [function.imagepng]:GD-PNG错误:在调色板颜色没有在C:\瓦帕\ WWW \吉普车\公共\测试\上线png_2.php 22

 


$x = 300; 
$y = 300; 

$final_img = imagecreate($x,$y) or die("Failed in call to 
imagecreate()
\n"); $image_1 = imagecreatefrompng('ae.png'); $image_2 = imagecreatefrompng('ad.png'); $image_3 = imagecreatefrompng('ao.png'); imagecopy($image_1, $final_img, 0, 0, 0, 0, $x, $y); imagecopy($image_2, $final_img, 0, 0, 0, 0, $x, $y); imagecopy($image_3, $final_img, 0, 0, 0, 0, $x, $y); imagealphablending($final_img, false); imagesavealpha($final_img, true); imagepng($final_img, 'final_img.png');
+0

在你的例子中哪一行是22? – Veger 2010-02-22 13:44:30

回答

4

您有前两个参数imagecopy颠倒。订单是目的地,来源。纠正这可能会解决错误。

http://php.net/imagecopy

+0

谢谢我没有抓住那个..我会投你一票,但我没有15代表还没有照顾 – jason 2010-02-23 11:09:40