首页上一页 1 下一页尾页 1 条记录 1/1页
php从入门到精通第二版第12章第240页
发表在PHP图书答疑
2011-06-30
是否精华
是
否
版块置顶:
是
否
使用GD2函数在照片上添加文字
这个实例老是有错
请帮忙修改,我有把照片换成我自己的照片
<?php
header("content-type:image/jpeg");
$im=imagecreatefromjpeg("images/1.jpg");
$textcolor=imagecolorallocate($im,56,73,136);
$fnt="c:/windows/fonts/Tahoma.ttf";
$motto=iconv("gb2312","utf-8","长白山天池");
imagettftext($im,220,0,480,340,$textcolor,$fnt,$motto);imagejpeg($im);
imagedestroy($im);
?>
谢谢大家,帮我修改一下
这是错误提示
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\xxx\d12j\2\2.php:2) in D:\AppServ\www\xxx\d12j\2\2.php on line 3
Warning: imagecreatefromjpeg(2/1.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in D:\AppServ\www\xxx\d12j\2\2.php on line 4
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in D:\AppServ\www\xxx\d12j\2\2.php on line 5
Warning: imagettftext() expects parameter 1 to be resource, boolean given in D:\AppServ\www\xxx\d12j\2\2.php on line 8
Warning: imagejpeg(): supplied argument is not a valid Image resource in D:\AppServ\www\xxx\d12j\2\2.php on line 8
Warning: imagedestroy(): supplied argument is not a valid Image resource in D:\AppServ\www\xxx\d12j\2\2.php on line 9
这个实例老是有错
请帮忙修改,我有把照片换成我自己的照片
<?php
header("content-type:image/jpeg");
$im=imagecreatefromjpeg("images/1.jpg");
$textcolor=imagecolorallocate($im,56,73,136);
$fnt="c:/windows/fonts/Tahoma.ttf";
$motto=iconv("gb2312","utf-8","长白山天池");
imagettftext($im,220,0,480,340,$textcolor,$fnt,$motto);imagejpeg($im);
imagedestroy($im);
?>
谢谢大家,帮我修改一下
这是错误提示
Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\xxx\d12j\2\2.php:2) in D:\AppServ\www\xxx\d12j\2\2.php on line 3
Warning: imagecreatefromjpeg(2/1.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in D:\AppServ\www\xxx\d12j\2\2.php on line 4
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in D:\AppServ\www\xxx\d12j\2\2.php on line 5
Warning: imagettftext() expects parameter 1 to be resource, boolean given in D:\AppServ\www\xxx\d12j\2\2.php on line 8
Warning: imagejpeg(): supplied argument is not a valid Image resource in D:\AppServ\www\xxx\d12j\2\2.php on line 8
Warning: imagedestroy(): supplied argument is not a valid Image resource in D:\AppServ\www\xxx\d12j\2\2.php on line 9