Home >Backend Development >PHP Tutorial >EmpireCMS watermark tiles
This article mainly introduces the EmpireCMS watermark tiling, which has certain reference value. Now I share it with you. Friends in need can refer to
Modify under /e/class/gd.php imageWaterMark method
is as follows
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);//拷贝水印到目标文件 } }
is changed to:
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; } } }
The above is the detailed content of EmpireCMS watermark tiles. For more information, please follow other related articles on the PHP Chinese website!