时间:2021-07-01 10:21:17 帮助过:14人阅读
修改 /e/class/gd.php下的imageWaterMark方法
如下
if($isWaterImage)//图片水印 { if($water_info[2]==3) { imagecopy($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h);//拷贝水印到目标文件 } else { imagecopymerge($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h,$w_pct);//拷贝水印到目标文件 } }
改为:
if($isWaterImage)//图片水印 { //定义平铺数据 $x_length = $ground_w - 10; //x轴总长度 $y_length = $ground_h - 10; //y轴总长度 if($water_info[2]==3) { //imagecopy($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h);//拷贝水印到目标文件 //循环平铺水印 for ($x = 0; $x < $x_length; $x) { for ($y = 0; $y < $y_length; $y) { imagecopy($ground_im, $water_im, $x, $y, 0, 0, $water_w, $water_h); $y += $water_h; } $x += $water_w; } } else { //imagecopymerge($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h,$w_pct);//拷贝水印到目标文件 //循环平铺水印 for ($x = 0; $x < $x_length; $x) { for ($y = 0; $y < $y_length; $y) { imagecopymerge($ground_im, $water_im, $x, $y, 0, 0, $water_w, $water_h, $w_pct); $y += $water_h; } $x += $water_w; } } }
以上就是EmpireCMS 水印平铺的详细内容,更多请关注Gxl网其它相关文章!