DedeCMS修改水印坐标调整水印位置教程

DedeCMS系统默认水印位置与图片边线相隔5像素,因此追求美观时需要修改水印的坐标,实现方法如下:

找到include目录下的image.class.php文件,查找以下代码:

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,也就是水印的位置,和下表是相对应的,这里你就可以修改后面的数据修改坐标了。

顶部居左 顶部居中 顶部居右

左边居中 图片中心 右边居中

底部居左 底部居中 底部居右

例如:想把水印图与原图的右底重合,就把第九项的两个“5”修改为“0”即可,以此类推,如果想把水印的位置往左上移动20像素,则修改为20即可。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/99ed6fe0a9ada8cfc56a16e18fd14111.html