PHP中应用GD2函数在图像上添加文字

<?php
     header("Content-type:text/html;charset=utf-8");
     header("Content-type:image/gif");
     $im=imagecreatefromjpeg("images/qie.jpg");
     $textcolor=imagecolorallocate($im,56,73,136);
     $fnt="c:/windows/fonts/simhei.ttf";
     $text="南极企鹅";
     iconv("gb2312","utf-8",$text);
     imagettftext($im,20,0,10,80,$textcolor,$fnt,$text);
     imagegif($im);
     imagedestroy($im);
?>

 

posted @ 2015-09-07 08:47  骏码信息  阅读(521)  评论(0编辑  收藏  举报