2010-02-22 89 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