Pop\Image\Gd::overlay PHP Метод

overlay() публичный Метод

Overlay an image onto the current image.
public overlay ( string $ovr, integer | string $x, integer | string $y ) : Gd
$ovr string
$x integer | string
$y integer | string
Результат Gd
    public function overlay($ovr, $x = 0, $y = 0)
    {
        // Create image resource and turn on alpha blending
        $this->createResource();
        imagealphablending($this->resource, true);
        // Create an image resource from the overlay image.
        if (stripos($ovr, '.gif') !== false) {
            $overlay = imagecreatefromgif($ovr);
        } else {
            if (stripos($ovr, '.png') !== false) {
                $overlay = imagecreatefrompng($ovr);
            } else {
                if (stripos($ovr, '.jp') !== false) {
                    $overlay = imagecreatefromjpeg($ovr);
                } else {
                    throw new Exception('Error: The overlay image must be either a JPG, GIF or PNG.');
                }
            }
        }
        // Copy the overlay image on top of the main image resource.
        imagecopy($this->resource, $overlay, $x, $y, 0, 0, imagesx($overlay), imagesy($overlay));
        $this->output = $this->resource;
        return $this;
    }