array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'imagick.cropimage.php', 1 => 'Imagick::cropImage', ), 'up' => array ( 0 => 'class.imagick.php', 1 => 'Imagick', ), 'prev' => array ( 0 => 'imagick.count.php', 1 => 'Imagick::count', ), 'next' => array ( 0 => 'imagick.cropthumbnailimage.php', 1 => 'Imagick::cropThumbnailImage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagick/cropimage.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL imagick 2, PECL imagick 3)
Imagick::cropImage — Extracts a region of the image
Extracts a region of the image.
width
The width of the crop
height
The height of the crop
x
The X coordinate of the cropped region's top left corner
y
The Y coordinate of the cropped region's top left corner
Liefert true
bei Erfolg.
Wirft ImagickException bei Fehlern.
Beispiel #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();
}
?>