©
This document uses PHP Chinese website manual Release
(PECL imagick 2.0.0)
Imagick::setImagePage — Sets the page geometry of the image
$width
, int $height
, int $x
, int $y
)Sets the page geometry of the image.
width
height
x
y
成功时返回 TRUE
。
错误时抛出 ImagickException。
[#1] Darren Burnhill [2009-05-19 05:03:26]
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);
?>