Home > Backend Development > PHP Tutorial > EmpireCMS watermark tiles

EmpireCMS watermark tiles

不言
Release: 2023-03-24 09:46:01
Original
1589 people have browsed it

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);//拷贝水印到目标文件
		}
    }
Copy after login

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;  
			} 
		}
    }
Copy after login



The above is the detailed content of EmpireCMS watermark tiles. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template