Grafika\Imagick\DrawingObject\Line::draw PHP Method

draw() public method

public draw ( Image $image ) : Image
$image Grafika\Imagick\Image
return Grafika\Imagick\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;
    }
Line