Grafika\Gd\DrawingObject\Line::draw PHP Метод

draw() публичный Метод

public draw ( Image $image ) : Image
$image Grafika\Gd\Image
Результат Grafika\Gd\Image
    public function draw($image)
    {
        list($x1, $y1) = $this->point1;
        list($x2, $y2) = $this->point2;
        list($r, $g, $b) = $this->color->getRgb();
        $color = imagecolorallocate($image->getCore(), $r, $g, $b);
        if (function_exists('imageantialias')) {
            // Not available on some if PHP is not precompiled with it even if GD is enabled
            imageantialias($image->getCore(), true);
        }
        imageline($image->getCore(), $x1, $y1, $x2, $y2, $color);
        return $image;
    }
Line