unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 =
class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
TPolygon =
Array of TPoint;
var
Form1: TForm1;
Dreieck: TPolygon;
implementation
{$R *.dfm}
procedure CreateTriangle(
var Polygon: TPolygon;
const Edge1, Edge2, Edge3: TPoint );
begin
SetLength( Polygon, 3 );
Polygon[0] := Edge1;
Polygon[1] := Edge2;
Polygon[2] := Edge3;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
CreateTriangle( Dreieck, Point( 100, 100 ), Point( 150, 50 ), Point( 200, 100 ) );
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
Canvas.Polygon( Dreieck );
end;
end.