- PHP 手册
- 函数参考
- 图像生成和处理
- ImageMagick
- Imagick
Imagick::extentImage
(PECL imagick 2, PECL imagick 3)
Imagick::extentImage — Set image size
说明
public Imagick::extentImage(int
$width
,int
$height
,int
$x
,int
$y
): bool
Comfortability method for setting image size. The method sets the image size and allows setting x,y coordinates where the new area begins. 此方法在Imagick基于ImageMagick 6.3.1以上版本编译时可用。
警告Prior to ImageMagick 6.5.7-8 (1623), $x was positive when shifting to the left and negative when shifting to the right, and $y was positive when shifting an image up and negative when shifting an image down. Somewhere betwen ImageMagick 6.3.7 (1591) and ImageMagick 6.5.7-8 (1623), the axes of $x and $y were flipped, so that $x was negative when shifting to the left and positive when shifting to the right, and $y was negative when shifting an image up and positive when shifting an image down. Somewhere between ImageMagick 6.5.7-8 (1623) and ImageMagick 6.6.9-7 (1641), the axes of $x and $y were flipped back to pre-ImageMagick 6.5.7-8 (1623) functionality.
参数
-
width
-
The new width
-
height
-
The new height
-
x
-
X position for the new size
-
y
-
Y position for the new size
返回值
成功时返回 true
。
参见
- Imagick::resizeImage() - Scales an image
- Imagick::thumbnailImage() - Changes the size of an image
- Imagick::cropImage() - 截图图片的一块区域
User Contributed Notes 2 notes
up down -4 bas at vdsluis dot net ¶12 years ago
This function cannot handle images with a transparent background. Use setImageExtent instead.
up
down
-11
orgoj ¶8 years ago
Some tiff image are corrupted, if used without prior calling setImageMatte(false).
add a note
官方地址:https://www.php.net/manual/en/imagick.extentimage.php