|
发表于 2011-1-31 22:45:24
|
显示全部楼层
你既然这样
$content=fread($fp,filesize($file_dir));//读文件
用了,为何下面不调用它呢
已经帮你修改好了[ol]header("Content-type:image/png");$file_dir="verchk.txt";$fp=fopen($file_dir,"r");$content=fread($fp,filesize($file_dir));//读文件fclose($fp);$fplen=strlen($content);//计算字符字数$mailaddressimages=imagecreate($fplen*10,25);//获得文件名图片信息。$lenadd=$fplen;$fontsize="4";$center=(imagesx($mailaddressimages)-8.3*strlen($content))/2; $mailimagesbackground=ImageColorAllocate($mailaddressimages,231,196,43); $mailimagesfacecolor=ImageColorAllocate($mailaddressimages,0,0,0); ImageString($mailaddressimages,$fontsize,$center,5,$content,$mailimagesfacecolor); Imagepng($mailaddressimages);ImageDestroy($mailaddressimages);[/ol]复制代码 |
|