RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Classes.Point Function

Creates a TPoint structure from a pair of coordinates.

Pascal
function Point(AX: Integer; AY: Integer): TPoint;
C++
TPoint Point(int AX, int AY);

Call Point to create a TPoint that represents the specified coordinates.  

C++ Examples: 

 

/*
This example draws a polygon in the specified shape, and
fills it with the color teal.
*/
void __fastcall TForm1::PaintBox1Paint(TObject *Sender)
{
  TPoint points[4];
  points[0] = Point(10,10);
  points[1] = Point(30,10);
  points[2] = Point(130,30);
  points[3] = Point(240,120);
  (dynamic_cast<TPaintBox *>(Sender))->Canvas->Brush->Color = clTeal;
  (dynamic_cast<TPaintBox *>(Sender))->Canvas->Polygon(points, 3);
}

 

Delphi Examples: 

{
This example draws a polygon in the specified shape, and
fills it with the color teal.
}
procedure TForm1.FormPaint(Sender: TObject);
begin
  Canvas.Brush.Color := clTeal;
  Canvas.Polygon([Point(10, 10), Point(30, 10),
    Point(130, 30), Point(240, 120)]);
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!