From RAD Studio API Documentation
Jump to: navigation, search



TRoundRect = class(TShape)


class PASCALIMPLEMENTATION TRoundRect : public TShape


Type Visibility Source Unit Parent
class public
FMX.Objects FMX.Objects


TRoundRect defines 2D rectangles with rounded corners. It inherits TControl and can be used in styles to construct controls.

The rectangle size and position are defined by the bounding rectangle of the TRoundRect object. You can use the scaling factors Scale of the TRoundRect object to proportionally change rectangle coordinates along local coordinate axes. This will move the rectangle and change its shape. The rotation axis RotationCenter and rotation angle RotationAngle of the TRoundRect object can be used to rotate the rectangle.

Note: Scaling not only scales the shape of an object proportionally to the scaling factors. It also changes the thickness of the stroke that draws the contour proportionally to the scaling factor for each axis.

The Corners property defines which rectangle corners are to be rounded. The Radius of the rounding is defined by the following formula:

Radius := Min(RectHeight(GetShapeRect),RectWidth(GetShapeRect)) / 2;  

TRoundRect draws the contour and fills the shape background with the Paint method.

Paint draws the contour and fills the background using the drawing pen and brush with the properties, color, and opacity defined by the Stroke and Fill properties of the TRoundRect object.

See Also