本文整理匯總了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);
}
示例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);
}
}