2011-07-14 96 views
1

基本上所有我想要做的是包括在签名的背景图像,尽管每次我尝试一些时间,我得到一个错误说:PHP签名图片生成

资源ID 4

我将是我得到任何的帮助真的很感谢..

<?php 
header("Content-type: image/png"); 

$image = imagecreatefrompng("../imgs/bisig1.png"); 
$other = imagecreatefrompng("../imgs/avatar.png"); 
//imagecolorallocate($image, R, G, B) in HEX values 
$font_black = imagecolorallocate($image, 2, 1, 8); 
$font_blue = imagecolorallocate($image, 25, 0, 255); 

$List = "name.txt"; 
$string = "Account Name"; 
$string2 = "<img src='$other'>"; 
//($image, fontsize, rightindent, downindent, data, txtcolour) 
imagestring($image, 3, 12, 3, "T17", $font_blue); 
imagestring($image, 1, 86, 6, "SOTW", $font_black); 
imagestring($image, 1, 110, 6, $string, $font_black); 
imagestring($image, 4, 110, 50, $other, $font_blue); 

imagepng($image); 
imagedestroy($image); 
imagepng($other); 
imagedestroy($other); 
?> 

回答

1

GD不是HTML($string2 = "<img src='$other'>";)和它不会工作 BTW你problably没有得到任何“资源ID 4”错误你的mime类型是PNG。