TcxCanvas.Rectangle(TRect,TcxViewParams,TcxBorders,TColor,Integer,Boolean) Method
Draws a rectangle on the canvas.
Declaration
procedure Rectangle(R: TRect; const AParams: TcxViewParams; const ABorders: TcxBorders = cxBordersAll; ABorderColor: TColor = clDefault; ALineWidth: Integer = 1; AExcludeRect: Boolean = False); overload;
Parameters
Name | Type |
---|---|
R | TRect |
AParams | TcxViewParams |
ABorders | TcxBorders |
ABorderColor | TColor |
ALineWidth | Integer |
AExcludeRect | Boolean |
Remarks
Call any of the overloaded procedure variants to draw a rectangle on the canvas.
Overloaded Variant | Description |
---|---|
1 | This overloaded variant uses the Brush and Pen settings to draw a target rectangle passed as the R parameter. |
2 | This variant works similarly to the first variant but accepts the coordinates of the left-top and right-bottom corners of the target rectangle as the X1, Y1, X2, and Y2 parameters. |
3 | This procedure variant accepts the target rectangle and new brush settings as the R and AParams parameters, respectively. You can pass the outline width and color as the optional ABorderColor and ALineWidth parameters to use them instead of the active Pen settings. Use the ABorders optional parameter to draw only specific borders instead of the complete outline. In addition, you can pass True as the optional AExcludeRect parameter to exclude the drawn rectangle from the clip region. |
4 | This overloaded variant accepts the target rectangle as the R parameter. Pass fill and outline colors as the ABrushColor and APenColor parameters. Use the APenStyle parameter to select a required style for the outline. Additionally, you can pass an outline pixel width as the optional APenWidth parameter. All these parameter values update the corresponding canvas brush and pen settings. |
See Also