GRAPHIC BOX statement

Purpose

Draw a box with square or rounded corners in the selected graphic target.

Syntax

GRAPHIC BOX (x1!, y1!) - (x2!, y2!) [, [corner&] [, [rgbColor&] [,

    [fillcolor&] [, [fillstyle&]]]]]

Remarks

The coordinates are specified in Page Units.  Line width can be set using GRAPHIC WIDTH.  If line width is set to 1 (the default), the line style can be set with GRAPHIC STYLE.  Because of the nature of a box, GRAPHIC BOX neither uses, nor updates, the last point referenced (POS).  Windows graphic conventions consider the bottom and right coordinates of a BOX to be exclusive.  The pixels at the bottom and right edges are not drawn unless Overlap Mode is enabled.  See GRAPHIC SET OVERLAP for details.

x1!, y1!  

The upper left corner of the box.

x2!, y2!  

The lower right corner of the box.

corner&

The percentage of roundness of the corners, in the range of 0 to 100.  A value of zero creates square corners, while 100 creates a circle/oval.  A value of 20 being most common for a pleasant, rounded appearance.  If corner& is omitted, the default is 0, which creates a rectangle with square corners.

rgbColor&

Optional RGB color of the box edge.  If omitted (or -1), the edge color defaults to the current foreground color for the selected graphic target.

fillcolor&

Optional RGB color of the box interior.  If fillcolor& is omitted (or -2), the interior of the box is not filled, allowing the background to show through.  If fillcolor& is -1, the interior is painted with the same color as the edge. Otherwise, fillcolor& specifies the RGB color to be used.

fillstyle&

Optional fill style (pattern) to be used.  If fillstyle& is omitted, the default fill style is solid (0).  If a hatch pattern is chosen (1 to 6), the foreground color is specified by the fillcolor&, while the background is specified by the default background color.  The optional fillstyle& may be:

0

Solid (default)

1

Horizontal Lines

2

Vertical Lines

3

Upward Diagonal Lines

4

Downward Diagonal Lines

5

Crossed Lines

6

Diagonal Crossed Lines

See also

Built In RGB Color Equates, GRAPHIC ATTACH, GRAPHIC COLOR, GRAPHIC LINE, GRAPHIC SET OVERLAP, GRAPHIC STYLE, GRAPHIC WIDTH

Example

' Draw rectangle with square corners and default colors.

GRAPHIC BOX (10, 10) - (100, 80)

 

' Draw a blue rectangle with 20% rounded corners,

' filled with a light-gray, diagonal cross pattern

GRAPHIC BOX (15, 15) - (95, 75), 20, %BLUE, RGB(191,191,191), 6