在图片上是不能用echo或者printf等输出文字的,只有用画。你可以用
imagettftext($img,10,0,150,90,$black,"c:/windows/fonts/simhei.ttf",$ttt);
$ttt表示你要显示文字的变量,前面的数字表示位置。
c:/windows/fonts/simhei.ttf"表示用什么字体画。
imagettftext($img,10,0,150,90,$black,"c:/windows/fonts/simhei.ttf",$ttt);
$ttt表示你要显示文字的变量,前面的数字表示位置。
c:/windows/fonts/simhei.ttf"表示用什么字体画。
那个函数我知道,但是用了没效果。唉。没有字体那。
要有函数库扩展,
php4.1.2好象还不支持这个函数.
<?php
dl("mb_string");
$txt = mb_convert_encoding("中文", "UTF-8", "GB2312");
$font_file = "./abc.ttf";
$font_size = 20
$txt_color = imagecolorallocate($image, 234, 121, 50);
imagettftext($image, $font_size, 0, 10, 20, $txt_color, $font_file, $txt);
?>