polygon input parameters

derez

Expert
Licensed User
Longtime User
Polygon should be able to accept the arrays of x and y coordinates either as strings or as numbers, see attached picture.

In the attached program - it doesn't, only strings are accepted.

Also - how can I input arraylists as coordinates arrays ? the program also demonstrates this problem.
 

Attachments

  • polygon.sbp
    761 bytes · Views: 256
Last edited:

agraham

Expert
Licensed User
Longtime User
Were did you see those method signatures? .NET 2.0, which is what Basic4ppc compiles to, only supports two variations and only one of those is implemented in the Compact Framework. The array (or ArrayList if it wasn't broken) is converted by Basic4ppc to an array of Points to pass to the method call.

B4X:
Graphics.DrawPolygon (Pen, Point[])  Draws a polygon defined by an array of Point structures. 
Supported by the .NET Compact Framework. 
 
Graphics.DrawPolygon (Pen, PointF[])  Draws a polygon defined by an array of PointF structures.

The ArrayList problem is a known bug in v6.90 http://www.b4x.com/forum/bug-reports/5850-polygon-v6-90-does-not-accept-arraylist.html
 

agraham

Expert
Licensed User
Longtime User
You seem to have found another bug in Polygon in the IDE. When compiled it will accept typed arrays (as well as ArrayLists) but the IDE, as well as not accepting ArrayList parameters as reported in the previous bug report, only accepts arrays of Strings and not Numbers as you have found.
 
Top