美文网首页
PHP学习-水印

PHP学习-水印

作者: Cookie_hunter | 来源:发表于2018-03-22 20:52 被阅读0次

输出图片,上标有“Cookie-hunter”字样;

<?php

//导入图像文件
$img = imagecreatefromjpeg('271960.jpg');
//设置水印:对象,字体大小,水印坐标X,水印坐标Y,水印内容,水印颜色
imagestring($img,5,300,300,'Cookie-hunter',imagecolorallocate($img,255,0,0));
//输出为png格式
header('Content-type: image/png');
imagepng($img);

相关文章

网友评论

      本文标题:PHP学习-水印

      本文链接:https://www.haomeiwen.com/subject/twszqftx.html