<?php
$img = 'images/w06.jpg';
$i = imagecreatefromjpeg($img);$w = imagesx($i);
$h = imagesy($i);$s = 30;
$a = 0;
$f = 'L:/wp/apache/htdocs/font/FZYTK.TTF';
$t = '教育机构 版权所有';
$tinfo = imagettfbbox($s, $a, $f, $t);$x = 30;
$y = 90;
$c = imagecolorallocatealpha($i, 255, 255, 255, 30);
imagettftext($i,$s,$a,$x,$y,$c,$f,$t);header('content-type:image/jpeg');
imagejpeg($i);
imagedestroy($i);
------------------------------------------------------------------------------------------------------------------割
如果把$f写成$f = 'font/FZYTK.TTF';的话,就会提示“图像**因存在错误无法显示”;
备注:我的程序文件是在L:/wp/apache/htdocs目录下
如图: