本文整理汇总了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();
}
示例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;
}
示例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);