最模板 - 外贸网站建设,外贸网站模板

最模板

当前位置: 首页 > 建站教程 > CMS教程 > DedeCMS教程 >

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

时间:2014-12-24 23:56来源: 作者: 点击:
在织梦默认的水印位置上是和图片的边缘有5个像素的距离,可能也会有很多朋友想要修改水印所在的位置,放在一个自己想要的位置上

在织梦默认的水印位置上是和图片的边缘有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”。

(责任编辑:最模板)
------分隔线----------------------------
栏目列表
推荐内容