XPRINT BOX statement

Purpose

Draw a box with square or rounded corners on a host printer page.

Syntax

XPRINT BOX (x1!, y1!) - (x2!, y2!) [, [corner&] [, [rgbColor&] [, [fillcolor&] [, [fillstyle&]]]]]

Remarks

Prior to any XPRINT operations, a host printer must first be selected with XPRINT ATTACH. The coordinate points are specified in pixels (or world coordinates, if those were chosen with XPRINT SCALE). Line width can be set using XPRINT WIDTH. If line width is set to 1 (the default), the line style can be set with XPRINT STYLE. Because of the nature of a box, XPRINT BOX neither uses, nor updates, POS (last point referenced). If executed without a host printer attached, error 57 is generated.

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 XPRINT 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 host printer page.

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 for the host printer page.  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, XPRINT ATTACH, XPRINT COLOR, XPRINT LINE, XPRINT SET OVERLAP, XPRINT STYLE, XPRINT WIDTH

Example

' Draw rectangle with square corners and default colors.

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

 

' Draw a blue rectangle with 20% rounded corners,

' filled with a light-gray, diagonal cross pattern

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