Line

Creates a line.

Parameters
point1

Array containing int X and int Y position of the starting point.

point2

Array containing int X and int Y position of the starting point.

thickness

Thickness in pixel. Note: This is currently ignored in GD editor and falls back to 1.

color

Color of the line. Defaults to black.

Examples

The following code would print the lines below:

// ...

$editor->draw($image, Grafika::createDrawingObject('Line', array(0, 0), array(200, 200), 1, new Color('#FF0000')));
$editor->draw($image, Grafika::createDrawingObject('Line', array(0, 200), array(200, 0), 1, new Color('#00FF00')));
$editor->draw($image, Grafika::createDrawingObject('Line', array(0, 0), array(200, 100), 1, new Color('#0000FF')));
$editor->draw($image, Grafika::createDrawingObject('Line', array(0, 100), array(200, 100)));
$editor->draw($image, Grafika::createDrawingObject('Line', array(100, 0), array(100, 200)));
lines