我在 php 中使用 Imagick 来显示图像后面的水印(图像),但不能。它显示在图像的前面
我的代码是:-
$watermark = new Imagick();
$watermark->readImage("watermark.png");
$wWidth = $watermark->getImageWidth();
$wHeight = $watermark->getImageHeight();
$iWidth = $im->getImageWidth();
$iHeight = $im->getImageHeight();
if ($iHeight < $wHeight || $iWidth < $wWidth) {
$watermark->scaleImage($iWidth, $iHeight);
$wWidth = $watermark->getImageWidth();
$wHeight = $watermark->getImageHeight();
}
$x = ($iWidth - $wWidth) / 2;
$y = ($iHeight - $wHeight) / 2;
$im->compositeImage($watermark,imagick::COMPOSITE_DEFAULT,$x,$y);
必须做什么才能使水印(图像)显示在图像后面而不是图像前面。