TCanvas.Rectangle procedure
Draws a
Rectangle with the specified coordinates.
Declaration
procedure Rectangle(X1: Integer; Y1: Integer; X2: Integer; Y2: Integer)
; virtual; reintroduce
procedure Rectangle(const ARect: TRect); reintroduceArguments
X1 | Coordinate for the left side of the rectangle. |
Y1 | Coordinate for the top side of the rectangle. |
X2 | Coordinate for the right side of the rectangle. |
Y2 | Coordinate for the bottom side of the rectangle. |
ARect |
Description
Rectangle is an overloaded method reintroduced in TCanvas. It is
used to draw a rectangular shape on the drawing area for the canvas. The
overloaded variants allow the coordinates to be specified as either:
- Four separate Integer values representing the position of the top, left, bottom, and right edges for the shape (X1, Y1, X2, Y2).
- A TRect instance where the vertices are represented as either four Integers, two TPoint instances for the TopLeft and BottomRight corner points, or a vector using the TArray4IntegerType (Rect).
Rectangle draws an outline (or borders) for the shape using the mode, style and width defined in Pen. The rectangle is also filled using the style, color and/or bitmap defined in Brush.
Use FillRect to fill a rectangular area with the current Brush without drawing its borders. Use FrameRect to draw the borders for the shape using the current Brush without filling the interior. Use Frame to draw borders for the shape using the current Pen and a clear Brush for the interior.
Rectangle calls the routine in the LCL interface used to implement the method for the current widgetset.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
