TCanvas.Frame procedure
Draws a frame or border around the specified rectangle using the Pen for the canvas.
Declaration
procedure Frame(const ARect: TRect); virtual
procedure Frame(X1: Integer; Y1: Integer; X2: Integer; Y2: Integer)Description
Frame is a method to draw a border or frame for the specified
rectangle using the Pen for the canvas. Overloaded variants of the method are
provided which allow the rectangle to be specified as:
- Four separate Integer coordinates representing the top/left and bottom/right of the rectangle.
- A TRect instance where the vertices are represented as either four Integers, two TPoint instances for TopLeft and BottomRight, or a vector using the TArray4IntegerType.
Frame sets the Style property in Brush to bsClear. This suppresses filling the interior of the rectangle with the Color for the Brush. In others words, the area inside the frame is transparent. The Brush style is restored to its previous value prior to exit.
Frame calls the Rectangle method to draw the borders on the frame using the Pen for the canvas.
Set property values in Pen prior to calling the method, including:
- Mode
- Style
- Color
- Width
- JoinStyle
- EndCap
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
