求助:php文字水印问题
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <?php header("Content-type: image/jpeg"); $image="D:\wamp\www\PKSEO\shuiyin\waterImage.gif"; //取得图片的大小 $img=GetImageSize($image); //$img[2] 中存储的是图片的格式 switch($img[2]) { case 1: $im=@ImageCreateFormGIF($image); break; case 2: $im=@ImageCreateFormJPEG($image); break; case 3: $im=@ImageCreateFormPNG($image); break; } //文字水印 $tc=imagecolorallocate($im,255,255,255);//颜色 $str=iconv("gbk","utf-8","新年");//输出内容 imagettftext($im,12,0,20,20,$tc,'C:\WINDOWS\Fonts\SIMSUN.TTC',$str);//写入图片 imagejpeg($im); imagedestroy($im); ?>