Imagick::setImageExtent

(PECL imagick 2.0.0)

Imagick::setImageExtentSets the image size

说明

bool Imagick::setImageExtent ( int $columns , int $rows )

Sets the image size (i.e. columns & rows).

参数

columns

rows

返回值

成功时返回 TRUE

错误/异常

错误时抛出 ImagickException。

User Contributed Notes

charles dot p dot hall at gmail dot com 30-Oct-2014 02:31
In other graphics systems I have seen this referred to as Canvas size or re-dimensioning. It changes the dimension of the image without re-scaling. Added pixels appear black, removed pixels are simply cropped away.
tim at komta dot com 19-Oct-2009 09:02
This function actually sets the width and height of the image (in pixels).

Took me forever to figure this out.