修改DedeCMS水印坐标及调整水印的位置

DedeCMS系统默认水印的位置与图片边线相隔5个像素,如果追求美观时需要修改水印的坐标,可以进行手工调节,实现方法如下: 

找到根目录include下的image.class.php文件,查找以下代码(大概在153行):

dedecms水印修改

                switch($this->watermarkstatus)
{
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,也就是水印的位置,和后台中图片水印设置是相对应的。
顶部居左 顶部居中 顶部居右
左边居中 图片中心 右边居中
底部居左 底部居中 底部居右
这里你可以修改后面的数据修改坐标
例如:想把水印图与原图的左上角重合,就把第1项的两个“5”修改为“0”即可,
其他修改方法如此,修改相信值即可。

 

posted on 2011-11-19 13:54  lingyue921  阅读(1077)  评论(0编辑  收藏  举报

导航