PHP 8.3.4 Released!

Imagick::getImageRegion

(PECL imagick 2, PECL imagick 3)

Imagick::getImageRegionИзвлекает область изображения

Описание

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

Извлекает область изображения и возвращает её в виде нового объекта Imagick.

Список параметров

width

Ширина извлечённой области.

height

Высота извлечённой области.

x

Координата X левого верхнего угла извлечённой области.

y

Координата Y левого верхнего угла извлечённой области.

Возвращаемые значения

Извлекает область изображения и возвращает её в виде новой палочки.

Ошибки

Вызывает ImagickException в случае ошибки.

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