Whitehat wrote:
> Yes I'm using Canvas.Polygon(Points).
> I set
> var
>   Points:array[0..99] of TPoint;
> Now if my procedure call is to use say only the first 20 points it goes
> ahead and uses the rest of the points as well. If there was data there
> from a previous call, what a mess. So, as I said, to get around it,  I
> just filled in the remainder of the points with the values for the last
> point.
> It works.
> I tried using an open array but it would not compile.

Something like the following works fine for me, what are you doing 
differently?

procedure TForm1.Button1Click(Sender: TObject);
var
   A: array of TPoint;
begin
   SetLength(A, 6);

   // draw a pentagon
   A[0].X := ClientWidth div 2; A[0].Y := 10;
   A[1].X := ClientWidth div 2; A[1].Y := 10;
   A[2].X := ClientWidth div 2 + 50 ; A[2].Y := 50;
   A[3].X := ClientWidth div 2 + 30; A[3].Y := 100;
   A[4].X := ClientWidth div 2 - 30; A[4].Y := 100;
   A[5].X := ClientWidth div 2 - 50; A[5].Y := 50;

   Canvas.Pen.Color := clRed;
   Canvas.Pen.Width := 3;
   Canvas.Polygon(A);
end;


Stephen Posey
[EMAIL PROTECTED]
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to