FMX.Objects.TRectangle

From Appmethod Libraries
Jump to: navigation, search

FMX.Objects.TShapeFMX.Controls.TControlFMX.Types.TFmxObjectSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTRectangle

Object Pascal

TRectangle = class(TShape)

C++

class PASCALIMPLEMENTATION TRectangle : public TShape

Properties

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

Description

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

The CornerType, XRadius, and YRadius properties define how to customize shapes of rectangle corners:

DrawRectCanvas.png

The Corners property specifies which corners in the TRectangle object are customized according to the CornerType, XRadius, and YRadius properties. By default, all four corners are customized.

Notice that, if Corners is an empty set or any of the XRadius or YRadius properties is zero, then no corner shape customization is used.

The rectangle size and position are defined by the following properties of the TRectangle object:

  • The shape rectangle ShapeRect defines the initial size and position of the rectangle.
  • You can use the rotation axis RotationCenter and rotation angle RotationAngle of the TRectangle object to rotate and move the rectangle.
  • You can use the scaling factors of the TRectangle object to proportionally scale rectangle coordinates along local coordinate axes. Scaling moves the rectangle and changes its size.
Note: Scaling not only scales the shape of an object proportionally to the scaling factors, but also changes the StrokeThickness of the contour proportionally to the scaling factor for each axis.

TRectangle draws the contour and fills the background with the Paint method. Paint uses the drawing pen and brush with the properties, color, and opacity defined by the Stroke, StrokeThickness, StrokeCap, StrokeDash, StrokeJoin, and Fill properties of the TRectangle object.

See Also

Code Examples