為什么我的文字水印帶描邊
水印帶有黑色的描邊,并且改變水印顏色不管用。
//打開圖片
$src = "p.png";
$info = getimagesize($src);
// echo "<pre>";
// print_r($info);
$type = image_type_to_extension($info[2],false);
$fun = "imagecreatefrom{$type}";
$image = $fun($src);
//操作圖片
$font = "msyh.ttf";
$content = "你好慕課";
// $content=iconv("GB2312","UTF-8",$content);
$col = imagecolorallocatealpha($image, 255, 255, 255, 50);
imagettftext($image, 40, 20, 100, 500, $col, $font, $content);
//輸出圖片
ob_clean();
header("Content-type:".$info['mime']);
$func = "image{$type}";
$func($image);
//保存圖片
$func($image,'newimage1.'.$type);
//銷毀圖片
imagedestroy($image);
2016-07-26
換下 字體文件 試下。