Unit 'Graphics' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TCanvas.RoundRect

Draws a rectangle with rounded corners at the specified position.

Declaration

Source position: graphics.pp line 1156

public procedure TCanvas.RoundRect(

  X1: Integer;

  Y1: Integer;

  X2: Integer;

  Y2: Integer;

  RX: Integer;

  RY: Integer

); virtual;

procedure TCanvas.RoundRect(

  const Rect: TRect;

  RX: Integer;

  RY: Integer

);

Arguments

X1

  

Left coordinate for the top, left corner of the rectangle.

Y1

  

Top coordinate for the top, left corner of the rectangle.

X2

  

Right coordinate for the bottom, right corner of the rectangle.

Y2

  

Bottom coordinate for the bottom, right corner of the rectangle.

RX

  

Width of the ellipse a quarter of which is drawn in the rounded corners. Note that this is the full width rather than the radius as suggested by the variable name.

RY

  

Height of the ellipse a quarter of which is drawn in the rounded corners. Note that this is the full height rather than the radius as suggested by the variable name.

Arguments

Rect

  

TRect instance with the coordinates for the rectangle vertices.

RX

  

Width of the ellipse a quarter of which is drawn in the rounded corners. Note that this is the full width rather than the radius as suggested by the variable name.

RY

  

Height of the ellipse a quarter of which is drawn in the rounded corners. Note that this is the full height rather than the radius as suggested by the variable name.

Description

RoundRect is an overloaded method in TCanvas used to draw a rectangle with rounded corners. The overloaded variants allow the coordinates to be specified as either:

RX and RY contain the width and height (respectively) for an ellipse used to draw arc segments for the rounded corners on the rectangular shape.

RoundRect (like Rectangle) draws an outline (or borders) for the shape using the mode, style and width defined in Pen. The rounded rectangle is also filled using the style, color and/or bitmap defined in Brush.

RoundRect calls the routine in the LCL interface used to implement the method for the current widgetset.

See also

LCLIntf.RoundRect

  

Draws a rectangle with rounded corners to the specified device context.


Version 4.4 Generated 2025-11-08 Home