FMX.Graphics.TCanvas.DrawRect

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DrawRect(const ARect: TRectF; const XRadius, YRadius: Single; const ACorners: TCorners;  const AOpacity: Single; const ACornerType: TCornerType = TCornerType.Round); overload;
procedure DrawRect(const ARect: TRectF; const XRadius, YRadius: Single; const ACorners: TCorners;  const AOpacity: Single; const ABrush: TStrokeBrush; const ACornerType: TCornerType = TCornerType.Round); overload;

C++

void __fastcall DrawRect(const System::Types::TRectF &ARect, const float XRadius, const float YRadius, const Fmx::Types::TCorners ACorners, const float AOpacity, const Fmx::Types::TCornerType ACornerType = (Fmx::Types::TCornerType)(0x0))/* overload */;
void __fastcall DrawRect(const System::Types::TRectF &ARect, const float XRadius, const float YRadius, const Fmx::Types::TCorners ACorners, const float AOpacity, TStrokeBrush* const ABrush, const Fmx::Types::TCornerType ACornerType = (Fmx::Types::TCornerType)(0x0))/* overload */;

Properties

Type Visibility Source Unit Parent
procedure
function
public
FMX.Graphics.pas
FMX.Graphics.hpp
FMX.Graphics TCanvas

Description

Draws a rectangle with customized shapes of corners on the current TCanvas.

DrawRect is implemented by TCanvas descendants to draw the ARect rectangle with customized corners, with the current Stroke or with the specified ABrush pen.

ARect specifies the rectangle to be drawn.

XRadius specifies the distance from a rectangle corner to the start point of the customization on horizontal sides. The maximum value of XRadius is half of the rectangle's width.

YRadius specifies the distance from a rectangle corner to the start point of the customization on vertical sides. The maximum value of YRadius is half of the rectangle's height.

ACorners specifies the corners to apply the customization to. ACorners can contain a set of constants defined in the TCorner type: TopLeft, TopRight, BottomLeft, and BottomRight. To apply the customization to all corners, use the AllCorners constant.

AOpacity specifies the transparency of the Stroke or ABrush color.

ABrush specifies the TStrokeBrush pen to use for drawing a shape on the rectangle.

ACornerType specifies the TCornerType type of corner shapes' customization. It is an optional parameter with a default value of Round.

DrawRectCanvas.png

To customize the drawing pen, use the Stroke, Thickness, Cap, Dash, and Join properties.

See Also

Code Examples