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);
?>
Basically all I am trying to do is include an image over the background of the signature although every time I try something I get an error saying:
Resource ID 4
I would be really thankful for any help I receive on this..
<?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);
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GD 不是 HTML (
$string2 = "";
),它不会工作顺便说一句,您可能不会收到任何“资源 ID 4”错误,因为您的 mime 类型是 png。
GD isn't HTML (
$string2 = "<img src='$other'>";
) and it won't workBTW you problably do not get any "Resource ID 4" error as your mime type is png.