当前位置: 首页>>代码示例>>PHP>>正文


PHP ImagickDraw::setStrokeLineCap方法代码示例

本文整理汇总了PHP中ImagickDraw::setStrokeLineCap方法的典型用法代码示例。如果您正苦于以下问题:PHP ImagickDraw::setStrokeLineCap方法的具体用法?PHP ImagickDraw::setStrokeLineCap怎么用?PHP ImagickDraw::setStrokeLineCap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImagickDraw的用法示例。


在下文中一共展示了ImagickDraw::setStrokeLineCap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setStrokeLineCap

function setStrokeLineCap($strokeColor, $fillColor, $backgroundColor)
{
    $draw = new \ImagickDraw();
    $draw->setStrokeColor($strokeColor);
    $draw->setFillColor($fillColor);
    $draw->setStrokeWidth(25);
    $lineTypes = [\Imagick::LINECAP_BUTT, \Imagick::LINECAP_ROUND, \Imagick::LINECAP_SQUARE];
    $offset = 0;
    foreach ($lineTypes as $lineType) {
        $draw->setStrokeLineCap($lineType);
        $draw->line(50 + $offset, 50, 50 + $offset, 250);
        $offset += 50;
    }
    $imagick = new \Imagick();
    $imagick->newImage(300, 300, $backgroundColor);
    $imagick->setImageFormat("png");
    $imagick->drawImage($draw);
    header("Content-Type: image/png");
    echo $imagick->getImageBlob();
}
开发者ID:sdmmember,项目名称:Imagick-demos,代码行数:20,代码来源:functions.php

示例2: brushpng

 public function brushpng($color, $size, $brushpath)
 {
     $info = $this->_handle->getImageGeometry();
     $image = new \Imagick();
     $image->newImage($info["width"], $info["height"], "transparent", "png");
     //$image->setImageFormat("png");
     $draw = new \ImagickDraw();
     $pixel = new \ImagickPixel();
     $pixel->setColor("transparent");
     $draw->setFillColor($pixel);
     $pixel->setColor($color);
     $draw->setStrokeColor($pixel);
     $draw->setStrokeWidth($size);
     $draw->setStrokeLineCap(\imagick::LINECAP_ROUND);
     $draw->setStrokeLineJoin(\imagick::LINEJOIN_ROUND);
     $draw->polyline($brushpath);
     $image->drawImage($draw);
     $pixel->destroy();
     $draw->destroy();
     $this->_handle = $image;
 }
开发者ID:locphp,项目名称:rsf,代码行数:21,代码来源:HandleImagek.php

示例3: ImagickPixel

printf("%.2f\n", $draw->getFillOpacity());
$draw->setFillRule(Imagick::FILLRULE_NONZERO);
var_dump($draw->getClipRule() === Imagick::FILLRULE_NONZERO);
// gravity
$draw->setGravity(Imagick::GRAVITY_SOUTHEAST);
var_dump($draw->getGravity() === Imagick::GRAVITY_SOUTHEAST);
// stroke
$draw->setStrokeAntialias(false);
var_dump($draw->getStrokeAntialias());
$draw->setStrokeColor(new ImagickPixel('#F02B88'));
var_dump($draw->getStrokeColor()->getColor());
$draw->setStrokeDashArray(array(1, 2, 3));
var_dump($draw->getStrokeDashArray());
$draw->setStrokeDashOffset(-1);
var_dump($draw->getStrokeDashOffset());
$draw->setStrokeLineCap(Imagick::LINECAP_SQUARE);
var_dump($draw->getStrokeLineCap() === Imagick::LINECAP_SQUARE);
$draw->setStrokeLineJoin(Imagick::LINEJOIN_BEVEL);
var_dump($draw->getStrokeLineJoin() === Imagick::LINEJOIN_BEVEL);
$draw->setStrokeMiterLimit(3);
var_dump($draw->getStrokeMiterLimit());
$draw->setStrokeOpacity(0.9);
printf("%.2f\n", $draw->getStrokeOpacity());
$draw->setStrokeWidth(1.2);
printf("%.2f\n", $draw->getStrokeWidth());
// text
$draw->setTextAlignment(Imagick::ALIGN_CENTER);
var_dump($draw->getTextAlignment() === Imagick::ALIGN_CENTER);
$draw->setTextAntialias(false);
var_dump($draw->getTextAntialias());
$draw->setTextDecoration(Imagick::DECORATION_LINETROUGH);
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:draw_accessor.php


注:本文中的ImagickDraw::setStrokeLineCap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。