显示图片,但是不显示水印文字,求助?已解决
显示图片,但不显示水印文字,代码如下:
<?php
$src='1.png';
$info=getimagesize($src);
$type=image_type_to_extension($info[2],false);
print_r($type);
$fun="imagecreatefrom{$type}";
$image=$fun($src);
$font='a010013l.pfb';
$content='hello world';
$color=imagecolorallocatealpha($image,0,0,0,50);
imagettftext($image,50,0,20,30,$color,'',$content);
ob_clean();
header("Content-type:".$info['mime']);
$func="image{$type}";
$func($image);
$func($image,'newimage.'.$type);
?>