vendor/grafika/src/Grafika/Imagick/DrawingObject/Line.php
(完整代码) 777B<?php
namespace Grafika\Imagick\DrawingObject;
use Grafika\DrawingObject\Line as Base;
use Grafika\DrawingObjectInterface;
use Grafika\Imagick\Image;
/**
* Class Line
* @package Grafika
*/
class Line extends Base implements DrawingObjectInterface
{
/**
* @param Image $image
*
* @return Image
*/
public function draw($image)
{
$strokeColor = new \ImagickPixel($this->getColor()->getHexString());
$draw = new \ImagickDraw();
$draw->setStrokeColor($strokeColor);
$draw->setStrokeWidth($this->thickness);
list($x1, $y1) = $this->point1;
list($x2, $y2) = $this->point2;
$draw->line($x1, $y1, $x2, $y2);
$image->getCore()->drawImage($draw);
return $image;
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
