ruby-libgd

GD::Image#line

Draws a straight line between two points.

Signature

line(x1, y1, x2, y2, color)

Parameters

Example

img = GD::Image.new(400,300)
blue = img.color(0,0,255)
img.line(20,20,380,280,blue)
img.save("line.png")

Notes

This method maps directly to gdImageLine in libgd.