一个超级强大的图片加水印的类(6)
case 8 : //下中 www.2cto.com
$this -> x = ($this -> srcImg_info[0] - $this -> waterImg_info[0]) / 2;
$this -> y = $this -> srcImg_info[1] - $this -> waterImg_info[1] - 20;
break 1;
case 9 : //下右
$this -> x = $this -> srcImg_info[0] - $this -> waterImg_info[0] - 20;
$this -> y = $this -> srcImg_info[1] - $this -> waterImg_info[1] - 20;
break 1;
default : //下右
$this -> x = $this -> srcImg_info[0] - $this -> waterImg_info[0] - 20;
$this -> y = $this -> srcImg_info[1] - $this -> waterImg_info[1] - 20;
break 1;
}
}
/**
* 加图片水印
*/
private function waterimg ()
{
if ($this -> srcImg_info[0] <= $this -> waterImg_info[0] || $this -> srcImg_info[1] <= $this -> waterImg_info[1]) {
echo '图片尺寸太小,无法加水印,请上传一张大图片';
exit();
}
//计算水印位置
$this->waterpos();
$cut = imagecreatetruecolor($this -> waterImg_info[0], $this -> waterImg_info[1]);
imagecopy($cut, $this -> im, 0, 0, $this -> x, $this -> y, $this -> waterImg_info[0],
相关新闻>>
- 发表评论
-
- 最新评论 更多>>