Graphics.DrawRoundRect

From Xojo Documentation

Revision as of 23:17, 4 June 2019 by Gperlman (talk | contribs)
Method

Graphics.DrawRoundRect(x As Double, y As Double, width As Double, height As Double, arcWidth As Double, arcHeight As Double)

Supported for all project types and targets.

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

Notes

X and Y are the coordinates of the top-left corner. Width and Height specify the size of the round rectangle. ArcWidth and ArcHeight control the shape of the corners in the horizontal and vertical axes, respectively. They are the distance (in pixels) from the corner at which the arc begins. Setting them to zero results in a rectangle with sharp corners.

Sample Code

This example draws two squares with a 5-pixel red border. The left square sets the arcs to 10 and the right one to 25.

g.ForeColor = &cff0000
g.PenHeight = 5
g.DrawRoundRect(10, 10, 100, 100, 10, 10)
g.DrawRoundRect(130, 10, 100, 100, 25, 25)