PHP 8.3.4 Released!

Imagick::getImageRegion

(PECL imagick 2, PECL imagick 3)

Imagick::getImageRegionExtrae una región de la imagen

Descripción

public Imagick::getImageRegion(
    int $width,
    int $height,
    int $x,
    int $y
): Imagick

Extrae una región de la imagen y la devuelve como un nuevo objeto Imagick.

Parámetros

width

El ancho de la región extraída.

height

El alto de la región extraída.

x

Coordenada X de la esquina superior izquierda de la región extraída.

y

Coordenada Y de la esquina superior izquierda de la región extraída.

Valores devueltos

Extrae una región de la imagen y la devuleve como una nueva varita mágica.

Errores/Excepciones

Lanza ImagickException en caso de error.

add a note

User Contributed Notes 1 note

up
6
zolcos at hotmail dot com
14 years ago
getImageRegion has the same side effect that was mentioned for operations that change the crop of the image -- the new image preserves the old canvas and positioning info. For example, using annotateImage on the new image will interpret the positioning arguments relative to the old image. To correct it, reset this info with setImagePage.

<?php
$im
->setImagePage(0, 0, 0, 0);
?>
To Top