本站资源均来自互联网,仅供学习与参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
Copyright @ 2015-2020 织梦园 版权所有
Power by DedeCms
鲁ICP备15039853号-1
鲁公网安备 37132302000249号
模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
在织梦默认的水印位置上是和图片的边缘有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”。