Graphics.DrawRectangle

From Xojo Documentation

Revision as of 15:32, 7 October 2019 by PLefebvre (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method

Graphics.DrawRectangle(x As Double, y As Double, width As Double, height As Double)

New in 2019r2

Supported for all project types and targets.

Draws the outline of a rectangle in the current color. The current color is set with the DrawingColor property.

Notes

X and Y are the coordinates of the top-left corner. Width and Height specify the size of the rectangle.

Sample Code

This example draws two squares with a 5-pixel red border.

g.DrawingColor = &cff0000
g.PenSize = 5
g.DrawRectangle(10, 10, 100, 100)
g.DrawRectangle(130, 10, 100, 100)