← Back to Index

TFlexFMXAdvancedRectangle

Enhanced rectangle shape with gradients, shadows, borders, and effects.

Key Properties

Fill: TBrush
Fill color, gradient, or pattern.
Stroke: TStrokeBrush
Border stroke properties (color, thickness, style).
CornerRadius: Single
Rounded corner radius (0 = square).
Corners: TCorners
Which corners to round: [crTopLeft, crTopRight, crBottomLeft, crBottomRight].
Shadow: Boolean
Enable drop shadow effect.
ShadowColor: TAlphaColor
Shadow color and opacity.
ShadowBlur: Single
Shadow blur radius.
ShadowOffsetX / ShadowOffsetY: Single
Shadow position offset.
GradientType: TGradientType
Gradient style: gtLinear, gtRadial, gtSweep.
GradientStops: TGradientPoints
Gradient color stops collection.

Usage Examples

Solid Color Rectangle

Rect1.Fill.Color := TAlphaColors.Blue;
Rect1.CornerRadius := 10;
Rect1.Stroke.Color := TAlphaColors.Darkblue;
Rect1.Stroke.Thickness := 2;

Gradient Background

Rect1.Fill.Kind := TBrushKind.Gradient;
Rect1.Fill.Gradient.Color := TAlphaColors.Blue;
Rect1.Fill.Gradient.Color1 := TAlphaColors.Purple;
Rect1.GradientType := gtLinear;

Card with Shadow

Rect1.Fill.Color := TAlphaColors.White;
Rect1.CornerRadius := 8;
Rect1.Shadow := True;
Rect1.ShadowBlur := 15;
Rect1.ShadowOffsetY := 5;
Rect1.ShadowColor := $30000000; // 19% black

Rounded Top Only

Rect1.CornerRadius := 15;
Rect1.Corners := [crTopLeft, crTopRight];
Rect1.Fill.Color := TAlphaColors.Lightgray;

Badge/Chip Shape

Rect1.Height := 30;
Rect1.Width := 80;
Rect1.CornerRadius := 15; // Pill shape
Rect1.Fill.Color := TAlphaColors.Green;
Rect1.Stroke.Kind := TBrushKind.None;

Dashed Border

Rect1.Fill.Color := TAlphaColors.White;
Rect1.Stroke.Color := TAlphaColors.Gray;
Rect1.Stroke.Thickness := 2;
Rect1.Stroke.Dash := TStrokeDash.Dash;

CSS Classes

Notes

← Back to Index