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即可。
以上教程由烈火學院編輯整理,如有不同意見請反饋給我們。
新聞熱點
疑難解答