在織夢(mèng)默認(rèn)的水印位置上是和圖片的邊緣有5個(gè)像素的距離,可能也會(huì)有很多朋友想要修改水印所在的位置,放在一個(gè)自己想要的位置上。
打開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就是水印的位置,只要修改上面代碼中的數(shù)據(jù)就可以修改水印位置了。以上9個(gè)位置依次對(duì)應(yīng)的也就是“頂部居左、頂部居中、頂部居右、左邊居中、圖片中心、右邊居中、底部居左、底部居中、底部居右”。
例:
case 9:
$x = $imagewidth - $logowidth - 5;
$y = $imageheight - $logoheight -5;
如果想要和默認(rèn)設(shè)置的水印位置重合,就要把“5”換成“0”。