1、前端模板:前端原图片和加过水印的图片显示对比<p class="notice red">原图:</p><img src="Public/images/original.jpg" alt="原图"/>
<p class="notice red" style="margin:10px 0">加完中文水印后:</p><img src="Public/images/new.jpg" alt="水印图"/>
2、主控制器引入Thinkphp水印类
open('Public/images/original.jpg')->water('Public/images/water_bg.png')->text($str, 'Public/images/simhei.ttf', 14, '#FFFFFF', \Think\Image::IMAGE_WATER_SOUTHEAST, -20)->save("Public/images/new.jpg"); $this->display(); }}?>有需要的童鞋请拿走哦; 演示地址: