输出图片,上标有“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);
网友评论