在織夢默認的水印位置上是和圖片的邊緣有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”。
以上就是織夢dede怎么修改圖片水印所在的位置的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答