Back to Image class

Method watermark

public \Joomla\CMS\Image\Image
watermark
(\Joomla\CMS\Image\Image $watermark, mixed $transparency = 50, mixed $bottomMargin = 0, mixed $rightMargin = 0)
Watermark the image
Parameters
  • \Joomla\CMS\Image\Image $watermark The Image object containing the watermark graphic
  • int $transparency The transparency to use for the watermark graphic
  • int $bottomMargin The margin from the bottom of this image
  • int $rightMargin The margin from the right side of this image
Returns
  • \Joomla\CMS\Image\Image
Since
  • 3.8.0
-
  • https://secure.php.net/manual/en/image.examples-watermark.php
Class: Image
Project: Joomla

Method watermark - Source code

/**
 * Watermark the image
 *
 * @param   Image    $watermark     The Image object containing the watermark graphic
 * @param   integer  $transparency  The transparency to use for the watermark graphic
 * @param   integer  $bottomMargin  The margin from the bottom of this image
 * @param   integer  $rightMargin   The margin from the right side of this image
 *
 * @return  Image
 *
 * @since   3.8.0
 * @link    https://secure.php.net/manual/en/image.examples-watermark.php
 */
public function watermark(Image $watermark, $transparency = 50, $bottomMargin = 0, $rightMargin = 0)
{
    imagecopymerge($this->getHandle(), $watermark->getHandle(), $this->getWidth() - $watermark->getWidth() - $rightMargin, $this->getHeight() - $watermark->getHeight() - $bottomMargin, 0, 0, $watermark->getWidth(), $watermark->getHeight(), $transparency);
    return $this;
}
OSZAR »