简体   繁体   English

如何在Imagick PHP的右侧放置水印?

[英]How to position watermark on right side in Imagick PHP?

How to position watermark label on right side in bottom? 如何在底部的右侧放置水印标签? I use Imagick php functions. 我使用Imagick php函数。

$image->compositeImage($watermark, imagick::COMPOSITE_OVER, 20, 20);

What param I need to change? 我需要更改什么参数?

Edit 编辑

Full explenation 全力以赴

// Calculate coordinates of top left corner
// of the sprite inside of the image
// "- 10" stands for offset to image border
$left = $imageWidth - $spriteWidth - 10;
$top = $imageHeight - $spriteHeight - 10;

$image->compositeImage($sprite,
        Imagick::COMPOSITE_DEFAULT,
        $left, $top);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM