织梦园模板网提供云优cms模板,pbootcms模板,Wordpress主题模板等各类企业新闻资讯网站模板下载服务。织梦园网站模板交流群
用户名:
密码:
注册
注册后享受折扣价

织梦dede怎么修改图片水印所在的位置

织梦园模板 / 2019-12-28 / 收藏
在织梦默认的水印位置上是和图片的边缘有5个像素的距离,可能也会有很多朋友想要修改水印所在的位置,放在一个自己想要的位置上。
打开include/image.class.php
找到以下代码:
case 1:
$x = +5;
$y = +5;
break;
case 2:
$x = ($imagewidth - $logowidth) / 2;
$y = +5;
break;
case 3:
$x = $imagewidth - $logowidth - 5;
$y = +5;
break;
case 4:
$x = +5;
$y = ($imageheight - $logoheight) / 2;
break;
case 5:
$x = ($imagewidth - $logowidth) / 2;
$y = ($imageheight - $logoheight) / 2;
break;
case 6:
$x = $imagewidth - $logowidth - 5;
$y = ($imageheight - $logoheight) / 2;
break;
case 7:
$x = +5;
$y = $imageheight - $logoheight - 5;
break;
case 8:
$x = ($imagewidth - $logowidth) / 2;
$y = $imageheight - $logoheight - 5;
break;
case 9:
$x = $imagewidth - $logowidth - 5;
$y = $imageheight - $logoheight -5;
break;
以上代码中的1-9就是水印的位置,只要修改上面代码中的数据就可以修改水印位置了。以上9个位置依次对应的也就是“顶部居左、顶部居中、顶部居右、左边居中、图片中心、右边居中、底部居左、底部居中、底部居右”。
例:
case 9:
$x = $imagewidth - $logowidth - 5;
$y = $imageheight - $logoheight -5;
如果想要和默认设置的水印位置重合,就要把“5”换成“0”。

相关辅助文档

收缩