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


PHP Driver::_rounded方法代碼示例

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


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

示例1: _rounded

 /**
  * Credit to Leif Åstrand <leif@sitelogic.fi> for the base of the round corners.
  *
  * Note there is a defect with this, as non-transparent corners get opaque circles of color. Maybe mask it with auto-generated corners?
  *
  * @link  http://www.imagemagick.org/Usage/thumbnails/#rounded
  */
 protected function _rounded($radius, $sides, $antialias = 0)
 {
     extract(parent::_rounded($radius, $sides, null));
     $image = '"' . $this->image_temp . '"';
     $r = $radius;
     $command = $image . " ( +clone -alpha extract " . (!$tr ? '' : "-draw \"fill black polygon 0,0 0,{$r} {$r},0 fill white circle {$r},{$r} {$r},0\" ") . "-flip " . (!$br ? '' : "-draw \"fill black polygon 0,0 0,{$r} {$r},0 fill white circle {$r},{$r} {$r},0\" ") . "-flop " . (!$bl ? '' : "-draw \"fill black polygon 0,0 0,{$r} {$r},0 fill white circle {$r},{$r} {$r},0\" ") . "-flip " . (!$tl ? '' : "-draw \"fill black polygon 0,0 0,{$r} {$r},0 fill white circle {$r},{$r} {$r},0\" ") . ') -alpha off -compose CopyOpacity -composite ' . $image;
     $this->exec('convert', $command);
 }
開發者ID:hiproz,項目名稱:mincms,代碼行數:15,代碼來源:Fuel_Imagemagick.php

示例2: _rounded

 protected function _rounded($radius, $sides, $antialias = 0)
 {
     extract(parent::_rounded($radius, $sides, null));
     $sizes = $this->sizes();
     $sizes->width_half = $sizes->width / 2;
     $sizes->height_half = $sizes->height / 2;
     if (!$tl) {
         $tlimage = $this->imagick->clone();
         $tlimage->cropImage($sizes->width_half, $sizes->height_half, 0, 0);
     }
     if (!$tr) {
         $trimage = $this->imagick->clone();
         $trimage->cropImage($sizes->width_half, $sizes->height_half, $sizes->width_half, 0);
     }
     if (!$bl) {
         $blimage = $this->imagick->clone();
         $blimage->cropImage($sizes->width_half, $sizes->height_half, 0, $sizes->height_half);
     }
     if (!$br) {
         $brimage = $this->imagick->clone();
         $brimage->cropImage($sizes->width_half, $sizes->height_half, $sizes->width_half, $sizes->height_half);
     }
     $this->imagick->roundCorners($radius, $radius);
     if (!$tl) {
         $this->imagick->compositeImage($tlimage, Fuel_Imagick::COMPOSITE_DEFAULT, 0, 0);
     }
     if (!$tr) {
         $this->imagick->compositeImage($trimage, Fuel_Imagick::COMPOSITE_DEFAULT, $sizes->width_half, 0);
     }
     if (!$bl) {
         $this->imagick->compositeImage($blimage, Fuel_Imagick::COMPOSITE_DEFAULT, 0, $sizes->height_half);
     }
     if (!$br) {
         $this->imagick->compositeImage($brimage, Fuel_Imagick::COMPOSITE_DEFAULT, $sizes->width_half, $sizes->height_half);
     }
 }
開發者ID:hiproz,項目名稱:mincms,代碼行數:36,代碼來源:Fuel_Imagick.php


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