background image

break; 
case 3://3

 

为顶端居右

$posX = $ground_w - $w; 
$posY = 0; 
break; 
case 4://4

 

为中部居左

$posX = 0; 
$posY = ($ground_h - $h) / 2; 
break; 
case 5://5

 

为中部居中

$posX = ($ground_w - $w) / 2; 
$posY = ($ground_h - $h) / 2; 
break; 
case 6://6

 

为中部居右

$posX = $ground_w - $w; 
$posY = ($ground_h - $h) / 2; 
break; 
case 7://7

 

为底端居左

$posX = 0; 
$posY = $ground_h - $h; 
break; 
case 8://8

 

为底端居中

$posX = ($ground_w - $w) / 2; 
$posY = $ground_h - $h; 
break; 
case 9://9

 

为底端居右

$posX = $ground_w - $w; 
$posY = $ground_h - $h; 
break; 
default://

 

随机

$posX = rand(0,($ground_w - $w)); 
$posY = rand(0,($ground_h - $h)); 
break; 

//

 

设定图像的混色模式

imagealphablending($ground_im, true); 
if($isWaterImage)//

 

图片水印


imagecopy($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h);//

 

拷贝水印到目标文件

else//

 

文字水印