コード例 #1
0
ファイル: Gd.php プロジェクト: aecca/zend-image
 /**
  * Crop image into specified frame
  *
  * @throws Zend_Image_Driver_Exception
  * @param int $left Left point to crop from
  * @param int $top Top point to crop from
  * @param int $width Width to crop
  * @param int $height Height to crop
  * @return bool
  */
 public function crop($left, $top, $width, $height)
 {
     parent::crop($left, $top, $width, $height);
     $imageSize = $this->getSize();
     $croppedImage = imagecreatetruecolor($width, $height);
     if ($this->_type == "png") {
         imagealphablending($croppedImage, true);
     }
     $successfull = imagecopyresized($croppedImage, $this->_image, 0, 0, $left, $top, $width, $height, $left + $width, $top + $height);
     unset($this->_image);
     $this->_image = $croppedImage;
     return $successfull;
 }
コード例 #2
0
ファイル: AbstractStub.php プロジェクト: eukov/zend-image
 public function load($fileName)
 {
     parent::load($fileName);
 }
コード例 #3
0
ファイル: Imagick.php プロジェクト: aecca/zend-image
 public function crop($left, $top, $targetWidth, $targetHeight)
 {
     parent::crop($left, $top, $targetWidth, $targetHeight);
     $this->_imagick->cropimage($targetWidth, $targetHeight, $left, $top);
 }