帝国CMS想要使用PNG格式当作水印怎么开发

92建站   帝国CMS   2021-06-24   收藏本文

本文介绍了帝国CMS想要使用PNG格式当作水印怎么开发,大家知道帝国的水印图片使用的是GIF格式,要是使用PNG格式的就不能正确显示,这就要用到二次开发功能,一起看看具体的实现方法吧。

旺铺招租1 旺铺招租2 旺铺招租3

下面就由92建站小编和大家说说帝国CMS使用PNG格式当作水印的开发方法。

实现教程:

打开 e/class/gd.php ,找在大约230行,找到

//设定图像的混色模式

imagealphablending($ground_im, true);

if($isWaterImage)//图片水印

{

imagecopymerge($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h,$w_pct);//拷贝水印到目标文件        

}

改为

//设定图像的混色模式

imagealphablending($ground_im, true);

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

}

}

这样就可以了,有此需要的朋友修改看看吧。

TAG标签: 帝国CMS水印
旺铺招租4
旺铺招租5 旺铺招租5
展开