Board index » delphi » ARRAYS of different sizes with canvas.polygon.

ARRAYS of different sizes with canvas.polygon.

Bernard <100635.1...@compuserve.com>,

Quote
>I have some problem with the objects 'canvas'.
>The method 'polygon' accept an ARRAY as parameter.
>But the method seems to look at systematically the whole array.
>How can I allocate only one ARRAY variable, and use it for polygons of different size?
>If somebody could give me an advice, I would be very happy.

  You must use the WindowsAPI (which has been nicely encapsulated
by Delphi) version of Polygon.  It accepts a parameter for the number of
points to use in the array.  So:

  Polygon (Canvas.Handle, MyArray, NumPointsToUse);

Good Luck,

-Ed Salgado
 Eminent Domain Software

 

Re:ARRAYS of different sizes with canvas.polygon.


Hello,
I have some problem with the objects 'canvas'.
The method 'polygon' accept an ARRAY as parameter.
But the method seems to look at systematically the whole array.
How can I allocate only one ARRAY variable, and use it for polygons of different size?
If somebody could give me an advice, I would be very happy.
Thanks
Bernard Louis.

Re:ARRAYS of different sizes with canvas.polygon.


Quote
Philipper Allart <100635.1...@compuserve.com> wrote:
>Hello,
>I have some problem with the objects 'canvas'.
>The method 'polygon' accept an ARRAY as parameter.
>But the method seems to look at systematically the whole array.
>How can I allocate only one ARRAY variable, and use it for polygons of different size?

        Use WinProcs.Polygon instead. Does the same thing except it takes
a "number of points" parameter. (Probably you knew this but there seem to
be people around here who don't: You use Camvas.Handle for the hDC with
API functions.)

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Other Threads