Maison  >  Article  >  développement back-end  >  Tuiles de filigrane EmpireCMS

Tuiles de filigrane EmpireCMS

不言
不言original
2018-04-18 10:49:211522parcourir

Cet article présente principalement le carrelage en filigrane EmpireCMS, qui a une certaine valeur de référence. Maintenant, je le partage avec vous. Les amis dans le besoin peuvent s'y référer

Modifier sous /e/class/gd.php L'imageWaterMark. la méthode

est la suivante :

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

est remplacée par :

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;  
			} 
		}
    }



Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Article précédent:Commandes liées à RedisArticle suivant:Commandes liées à Redis