(PECL imagick 2.0.0)
Imagick::cropImage — 锟斤拷图图片锟斤拷一锟斤拷锟斤拷锟斤拷
$width
, int $height
, int $x
, int $y
) : bool锟斤拷图图片锟斤拷一锟斤拷锟斤拷锟斤拷
width
锟斤拷图锟侥匡拷锟�
height
锟斤拷图锟侥高讹拷
x
锟矫硷拷锟斤拷锟斤拷锟斤拷锟较角碉拷 X 锟斤拷锟斤拷锟疥(锟斤拷原图锟斤拷锟斤拷锟较斤拷为原锟姐)
y
锟矫硷拷锟斤拷锟斤拷锟斤拷锟较角碉拷 X 锟斤拷锟斤拷锟疥(锟斤拷原图锟斤拷锟斤拷锟较斤拷为原锟姐)
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷
锟斤拷锟斤拷时锟阶筹拷 ImagickException锟斤拷
Example #1 Imagick::cropImage()
<?php
function cropImage($imagePath, $startX, $startY, $width, $height) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->cropImage($width, $height, $startX, $startY);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>