Imagick::setImagePage
(PECL imagick 2, PECL imagick 3)
Imagick::setImagePage — Sets the page geometry of the image
说明
Sets the page geometry of the image.
参数
width
-
height
-
x
-
y
-
返回值
成功时返回 true
。
错误/异常
错误时抛出 ImagickException。
+添加备注
用户贡献的备注 1 note
Darren Burnhill ¶
15 years ago
This would appear to be the equivalent of +repage in ImageMagick.
<?php
$ImagickObj = new Imagick($sourceImagePath);
$ImagickObj->cropImage($_POST['w'], $_POST['h'], $_POST['x'], $_POST['y']);
$ImagickObj->setImagePage($_POST['w'], $_POST['h'], 0, 0);
$ImagickObj->writeImage($cropFilePath);
?>