Draws a rectangle on an object.
Object.Rectangle ( [bStep1,] [fX1,] [fY1,] [bStep2,] fX2, fY2 [, clr] [, clrFill] )
The Rectangle method syntax has the following parts:
Name |
Type |
Description |
Object |
AForm |
AForm object |
bStep1 |
Val Variant |
Expects a boolean that specifies whether the coordinates are relative to the current graphics position given by the CurrentX and CurrentY properties. |
fX1 |
Val Variant |
The X coordinate of the starting point for the rectangle. The ScaleMode property determines the unit of measure used. If omitted, the line begins at the position indicated by CurrentX. |
fY1 |
Val Variant |
The Y coordinate of the starting point for the rectangle. The ScaleMode property determines the unit of measure used. If omitted, the line begins at the position indicated by CurrentY. |
bStep2 |
Val Variant |
Expects a boolean that specifies whether the coordinates are relative to fX1 and fY1. |
fX2 |
Val Float |
The X coordinate of the end point for the rectangle being drawn. |
fY2 |
Val Float |
The Y coordinate of the end point for the rectangle being drawn. |
IColor |
Val Variant |
Long integer value indicating the RGB color of the rectangle's outline. If omitted, the value of the ForeColor property is used. The RGB function or QBColor function can be used to specify the color. |
IFillColor |
Val Variant |
Long integer value indicating the RGB color to fill the rectangle. If omitted, the value of the FillColor property is used. The RGB function or QBColor function can be used to specify the color. |
bStep1 and bStep2 can have the following values:
Variable |
Value |
Description |
bStep1 |
True |
The coordinates are relative to the current graphics position given by the CurrentX and CurrentY properties. |
False * |
The coordinates are absolute. |
|
bStep2 |
True |
The coordinates are relative to fX1 and fY1. |
False * |
The coordinates are absolute. |
The width of the line drawn depends on the setting of the DrawWidth property. The way a line or box is drawn on the background depends on the setting of the DrawMode and DrawStyle properties.
When Rectangle executes, the CurrentX and CurrentY properties are set to the end point specified by the arguments.
The following statement draws a rectangle on the AForm starting relative to the CurrentX and CurrentY values, at x1=50 units, y1=60 units, and ending at x2=70 and y2=80, the line drawn in green and filled with pink:
frm1.Line(True,50,60,False,70,80,aclrGreen,aclrRed)
Circle, CurrentX, CurrentY, DrawMode, DrawStyle, DrawWidth, FillColor, ForeColor, Line, Scale, ScaleMode