Vcl.Graphics.TCustomCanvas.Rectangle

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Rectangle(X1, Y1, X2, Y2: Integer); overload; virtual; abstract;
procedure Rectangle(const Rect: TRect); overload;

C++

virtual void __fastcall Rectangle(int X1, int Y1, int X2, int Y2) = 0 /* overload */;
void __fastcall Rectangle(const System::Types::TRect &Rect)/* overload */;

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.Graphics.pas
Vcl.Graphics.hpp
Vcl.Graphics TCustomCanvas

Description

Draws a rectangle on the canvas.

Override the Rectangle method to implement drawing a rectangle using the pen and fill it with the current brush. Specify the rectangle's coordinates in one of two ways:

  • Giving four coordinates that define the upper-left corner at the point (X1, Y1) and the lower-right corner at the point (X2, Y2).
  • Using a TRect type.

To fill a rectangular region without drawing the boundary in the current pen, use FillRect. To outline a rectangular region without filling it, use FrameRect or Polygon. To draw a rectangle with rounded corners, use RoundRect.

See Also