RECTANGLE

Reviewed September 2011

//RECTANGLE, left, top, right, bottom {,fill {,crwidth {,crheight}}}

RECTANGLE draws a rectangle at the specified coordinates in the current mapping mode (as determined by SETMAPMODE), with optionally rounded corners.

Parameters

left, top, right, bottom

specify the respective sides of the rectangle, in the current mapping units

fill

select a value for fill from the table below. See the topic Parameters: Symbols vs. Values if you have questions about which to use.

Symbol

Value

Description

WHITE_BRUSH

0

White

LTGRAY_BRUSH

1

Light gray

GRAY_BRUSH

2

Gray

DKGRAY_BRUSH

3

Dark gray

BLACK_BRUSH

4

Black

NULL_BRUSH

5

Hollow (default)

 

The light gray, gray, and dark gray fill values will be overridden by a brush defined using SETBRUSH.

Regardless of the fill option, a border will be drawn around the rectangle using the current pen (see SETPENEX). To achieve a solid colored rectangle with no apparent border, set the RGB background in both the SETPENEX and SETBRUSH to the same color.

crwidth, crheight

These optional parameters refer to the "corner radius" width and height, in the current mapping units. For normal (symmetrical) rounded corners, crheight is not needed, and crwidth should be set to the radius of the circle used to draw the arc of the rounded corner. When crheight is specified, the corners are made from the arc of an ellipse whose total height (bounding rectangle) is two times crheight and whose total width is two times crwidth.