如何在左侧而非右侧的图像上添加水印

Mos*_*ady 0 php

你好, 我正在使用这个代码,它的工作非常好,但它在右边添加了徽标,我想在左边

Nan*_*nne 5

我看到这些线条:

21     // destination x and y
22     $imageWidth-$logoWidth, $imageHeight-$logoHeight,
Run Code Online (Sandbox Code Playgroud)

这可能是从水印开始写入的位置(减去图像的宽度)底部(减去高度)点的右侧(减去图像的宽度).

尝试并将其替换为例如左上角:

21     // destination x and y
22     0 , 0,
Run Code Online (Sandbox Code Playgroud)

或者如果你想要左下角,试试:

21     // destination x and y
22     0 , $imageHeight-$logoHeight,
Run Code Online (Sandbox Code Playgroud)