Graphics Function: Draws a rectangle using the current graphics color, logical write mode, and line style.
Module: USE DFLIB
Syntax
Results:
The result is of type INTEGER(2). The result is nonzero if successful; otherwise, 0.
The RECTANGLE function uses the viewport-coordinate system. The viewport coordinates (x1, y1) and (x2, y2) are the diagonally opposed corners of the rectangle.
The RECTANGLE_W function uses the window-coordinate system. The window coordinates (wx1, wy1) and (wx2, wy2) are the diagonally opposed corners of the rectangle.
SETCOLORRGB sets the current graphics color. SETFILLMASK sets the current fill mask. By default, filled graphic shapes are filled solid with the current color.
If you fill the rectangle using FLOODFILLRGB, the rectangle must be bordered by a solid line style. Line style is solid by default and can be changed with SETLINESTYLE.
Compatibility
STANDARD GRAPHICS QUICKWIN GRAPHICS LIB
See Also: SETFILLMASK, GRSTATUS, LINETO, POLYGON, FLOODFILLRGB, SETLINESTYLE, SETCOLOR, SETWRITEMODE
Example
This program draws the rectangle shown below.
! Build as a QuickWin or Standard Graphics App.
USE DFLIB
INTEGER(2) dummy, x1, y1, x2, y2
x1 = 80; y1 = 50
x2 = 240; y2 = 150
dummy = RECTANGLE( $GBORDER, x1, y1, x2, y2 )
END
Figure: Output of Program RECTNGL.FOR