Thema: Polygon

Einzelnen Beitrag anzeigen

mr_emre_d
(Gast)

n/a Beiträge
 
#2

Re: Polygon

  Alt 19. Mär 2009, 17:42
Delphi-Quellcode:
type
  TPolygon = Array of TPoint;

...

procedure CreateTriangle( var Polygon: TPolygon; const Edge1, Edge2, Edge3: TPoint );
begin
  SetLength( Polygon, 3 );
  Polygon[0] := Edge1;
  Polygon[1] := Edge2;
  Polygon[2] := Edge3;
end;

//formcreate:
  CreateTriangle( Dreieck, Point( 100, 100 ), Point( 150, 50 ), Point( 200, 100 ) );

//formpaint
  Canvas.Polygon( Dreieck );
  Mit Zitat antworten Zitat