phpGD库-文字水印
文字水印
步骤:
1. 获取图片资源
2. 颜色
3. 设置水印
imagettftext(图片资源,文字大小,角度,位置x,位置y,颜色,字体,水印内容)
4.保存
5.移除资源
//获取图片资源
$img = imagecreatefrompng('./imgs/01.png');
//水印
imagettftext($img,60,45,500,500,imagecolorallocate($img,180,0,250),'./font/3.ttf','sdsadsads');
//输出
header("content-type:image/png");
imagepng($img);
//销毁
imagedestroy($img);
本站文章如未注明出处均为原创,转载请注明出处,如有侵权请邮件联系站长。