當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Imagick::rotateImage方法代碼示例

本文整理匯總了PHP中Imagick::rotateImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Imagick::rotateImage方法的具體用法?PHP Imagick::rotateImage怎麽用?PHP Imagick::rotateImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Imagick的用法示例。


在下文中一共展示了Imagick::rotateImage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: rotate

 /**
  * Rotates an image to $deg degree
  * @param integer $deg: The amount to rotate
  * @param string $bgcolor: The background color in html hexadecimal notation
  * @return sfFilebasePluginImage $image: THe rotated image
  */
 public function rotate($deg, $bgcolor)
 {
     $ret_val = $this->destination_resource->rotateImage(new ImagickPixel($bgcolor), $deg);
     if ($ret_val !== true) {
         throw new sfFilebasePluginException(sprintf('Failed to rotate image %s.', $this->source));
     }
     return $ret_val;
 }
開發者ID:jmoulin,項目名稱:sfFilebasePlugin,代碼行數:14,代碼來源:sfFilebasePluginGfxEditorAdapterIMagick.php

示例2: _rotate

 protected function _rotate($degrees)
 {
     if ($this->im->rotateImage(new ImagickPixel(), $degrees)) {
         $this->width = $this->im->getImageWidth();
         $this->height = $this->im->getImageHeight();
         return true;
     }
     return false;
 }
開發者ID:navi8602,項目名稱:wa-shop-ppg,代碼行數:9,代碼來源:waImageImagick.class.php

示例3: gradientRight

function gradientRight($width, $height)
{
    $imagick = new Imagick();
    $imagick->newPseudoImage($width, $height, 'gradient:white-black');
    $imagick->rotateImage('none', 90);
    return $imagick;
}
開發者ID:atawsports2,項目名稱:Imagick-demos,代碼行數:7,代碼來源:createSourceImages.php

示例4: rotate

 /**
  * @param  $angle
  * @param bool $autoResize
  * @param string $color
  * @return Pimcore_Image_Adapter_Imagick
  */
 public function rotate($angle)
 {
     $this->resource->rotateImage(new ImagickPixel('none'), $angle);
     $this->setWidth($this->resource->getimagewidth());
     $this->setHeight($this->resource->getimageheight());
     $this->reinitializeImage();
     return $this;
 }
開發者ID:shanky0110,項目名稱:pimcore-custom,代碼行數:14,代碼來源:Imagick.php

示例5: _rotate

 /**
  * Rotate the image.
  * @param int $degrees
  */
 protected function _rotate($degrees)
 {
     if ($this->im->rotateImage(new \ImagickPixel('transparent'), $degrees)) {
         $this->width = $this->im->getImageWidth();
         $this->height = $this->im->getImageHeight();
         $this->im->setImagePage($this->width, $this->height, 0, 0);
     }
 }
開發者ID:dgan89,項目名稱:yii2-image,代碼行數:12,代碼來源:Imagick.php

示例6: rotate

 /**
  * Rotate the image by a given degrees
  *
  * @param int   $degrees
  * @param int   $background
  * @param float $alpha
  *
  * @return static
  */
 public function rotate($degrees, $background = 0xffffff, $alpha = 1.0)
 {
     $backgroundColor = sprintf('rgba(%u,%u,%u,%f)', $background >> 16 & 0xff, $background >> 8 & 0xff, $background & 0xff, $alpha);
     $this->_image->rotateImage(new \ImagickPixel($backgroundColor), $degrees);
     $this->_image->setImagePage($this->_width, $this->_height, 0, 0);
     $this->_width = $this->_image->getImageWidth();
     $this->_height = $this->_image->getImageHeight();
     return $this;
 }
開發者ID:manaphp,項目名稱:manaphp,代碼行數:18,代碼來源:Imagick.php

示例7: rotate

 public static function rotate(Imagick $image, $params)
 {
     if (isset($params[0])) {
         $angle = $params[0];
         if ($angle > 0 && $angle < 360) {
             $image->rotateImage(new ImagickPixel('none'), $angle);
         }
     }
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:9,代碼來源:Effects.php

示例8: rotate

 /**
  * Rotate the current image.
  *
  * @param integer $angle       The angle to rotate the image by,
  *                             in the clockwise direction.
  * @param integer $background  The background color to fill any triangles.
  */
 public function rotate($angle, $background = 'white')
 {
     try {
         $this->_imagick->rotateImage($background, $angle);
     } catch (ImagickException $e) {
         throw new Horde_Image_Exception($e);
     }
     $this->clearGeometry();
 }
開發者ID:jubinpatel,項目名稱:horde,代碼行數:16,代碼來源:Imagick.php

示例9: rotate

 public function rotate($angle)
 {
     // Rotate
     try {
         $return = $this->_resource->rotateImage(new ImagickPixel('none'), $angle);
     } catch (ImagickException $e) {
         throw new Engine_Image_Adapter_Exception(sprintf('Unable to rotate image: %s', $e->getMessage()), $e->getCode());
     }
     return $this;
 }
開發者ID:febryantosulistyo,項目名稱:ClassicSocial,代碼行數:10,代碼來源:Imagick.php

示例10: rotate

 public function rotate($degree, $color = 'FFFFFF')
 {
     $rgb = $this->html2rgb($color);
     for ($r = 0; $r < count($this->image); $r++) {
         $this->image->nextImage();
         $this->image->rotateImage(new ImagickPixel('rgba(' . $rgb[0] . ',' . $rgb[1] . ',' . $rgb[2] . ',0)'), $degree);
     }
     $this->info['width'] = $this->image->getImageWidth();
     $this->info['height'] = $this->image->getImageHeight();
 }
開發者ID:NareshChennuri,項目名稱:pyng,代碼行數:10,代碼來源:Imagick.php

示例11: rotate

 /**
  * @param $angle
  * @return $this
  */
 public function rotate($angle)
 {
     $this->preModify();
     $this->resource->rotateImage(new \ImagickPixel('none'), $angle);
     $this->setWidth($this->resource->getimagewidth());
     $this->setHeight($this->resource->getimageheight());
     $this->postModify();
     $this->setIsAlphaPossible(true);
     return $this;
 }
開發者ID:Gerhard13,項目名稱:pimcore,代碼行數:14,代碼來源:Imagick.php

示例12: rotate

 public function rotate($newFile, $angle)
 {
     $imagick = new Imagick();
     $imagick->readImage($this->_file);
     $imagick->rotateImage(new ImagickPixel('#ffffff'), $angle);
     //$imagick->rotateImage(new ImagickPixel('transparent'), $angle);
     $imagick->writeImage($newFile);
     $imagick->clear();
     $imagick->destroy();
 }
開發者ID:piratevn,項目名稱:cms-gio,代碼行數:10,代碼來源:ImageMagick.php

示例13: process

 public function process(\Imagick $image)
 {
     $info = getimagesize($this->_file);
     if ($info['mime'] != 'image/jpeg') {
         return $image;
     }
     if (!($exif_data = exif_read_data($this->_file))) {
         return $image;
     }
     if (isset($exif_data['Orientation'])) {
         $ort = $exif_data['Orientation'];
         if ($ort > 1) {
             switch ($ort) {
                 case 2:
                     $image->flopImage();
                     break;
                 case 3:
                     $image->rotateImage(new \ImagickPixel(), 180);
                     break;
                 case 4:
                     $image->flipImage();
                     break;
                 case 5:
                     $image->flopImage();
                     $image->rotateImage(new \ImagickPixel(), 270);
                     break;
                 case 6:
                     $image->rotateImage(new \ImagickPixel(), 90);
                     break;
                 case 7:
                     $image->flopImage();
                     $image->rotateImage(new \ImagickPixel(), 90);
                     break;
                 case 8:
                     $image->rotateImage(new \ImagickPixel(), 270);
                     break;
             }
         }
     }
     return $image;
 }
開發者ID:romainbureau,項目名稱:Custom,代碼行數:41,代碼來源:FixOrientation.php

示例14: convertExifToJFIF

 /**
  * 入力された畫像がExifであればエラーを記録し、JFIFに変換します。
  * @param \Imagick $imagick JFIFかExif。
  */
 protected function convertExifToJFIF(\Imagick $imagick)
 {
     if ($imagick->getImageProperties('exif:*')) {
         $this->logger->error(sprintf(_('「%s」はExif形式です。'), $this->filename));
         switch ($imagick->getImageOrientation()) {
             case \Imagick::ORIENTATION_TOPRIGHT:
                 $imagick->flopImage();
                 break;
             case \Imagick::ORIENTATION_BOTTOMRIGHT:
                 $imagick->rotateImage('none', 180);
                 break;
             case \Imagick::ORIENTATION_BOTTOMLEFT:
                 $imagick->rotateImage('none', 180);
                 $imagick->flopImage();
                 break;
             case \Imagick::ORIENTATION_LEFTTOP:
                 $imagick->rotateImage('none', 90);
                 $imagick->flopImage();
                 break;
             case \Imagick::ORIENTATION_RIGHTTOP:
                 $imagick->rotateImage('none', 90);
                 break;
             case \Imagick::ORIENTATION_RIGHTBOTTOM:
                 $imagick->rotateImage('none', 270);
                 $imagick->flopImage();
                 break;
             case \Imagick::ORIENTATION_LEFTBOTTOM:
                 $imagick->rotateImage('none', 270);
                 break;
         }
         $imagick->stripImage();
     }
 }
開發者ID:esperecyan,項目名稱:dictionary-php,代碼行數:37,代碼來源:ImageValidator.php

示例15: rotate

 public function rotate($angle, $bg_color = 0xffffff, $bg_opacity = 0)
 {
     if ($this->multiframe()) {
         foreach ($this->image as $frame) {
             $frame->rotateImage($this->get_color($bg_color, $bg_opacity), -$angle);
             $frame->setImagePage($this->image->width, $this->image->height, 0, 0);
         }
     } else {
         $this->image->rotateImage($this->get_color($bg_color, $bg_opacity), -$angle);
     }
     $this->update_size($this->image->getImageWidth(), $this->image->getImageHeight());
     return $this;
 }
開發者ID:anp135,項目名稱:altocms,代碼行數:13,代碼來源:Imagick.php


注:本文中的Imagick::rotateImage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。