ruby-libgd

GD::Image#rectangle

Draws a rectangular outline on the image.

Signature

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

Parameters

Example

img = GD::Image.new(400,300)
red = img.color(255,0,0)
img.rectangle(50,50,200,150,red)
img.save("rect.png")

Notes

This method maps directly to the native gdImageRectangle function in libgd.