DrawPoly Draw a polygon on the Canvas.
 Syntax
 [C#] ```XRect DrawPoly(IEnumerable inPointCoords, DrawOptions inOptions); XRect DrawPoly(IEnumerable inPoints, DrawOptions inOptions); ``` [Visual Basic] ```Function DrawPoly(inPointCoords As IEnumerable(Of Double), inOptions As DrawOptions) As XRect Function DrawPoly(inPoints As IEnumerable(Of XPoint), inOptions As DrawOptions) As XRect ```
 Params
 Name Description inPointCoords The polygon point coordinates. inOptions The draw options. inPoints The polygon points. return The drawn area.
 Notes

Draw the polygon identified by the points or point coordinates using the properties specified by DrawOptions.

 Example

Here we paint and draw a red circle.

[C#]

``````Canvas canvas = new Canvas(250, 250);
canvas.PaintColor = new XColor(Color.Red);
canvas.PenColor = new XColor(Color.Red);
XPoint[] points = new XPoint[127];
for (int i = 0; i <= 126; i++) {
double x = (100 * Math.Cos(i / 20.0)) + 125;
double y = (100 * Math.Sin(i / 20.0)) + 125;
points[i] = new XPoint(x, y);
}
canvas.DrawPoly(points, new DrawOptions(canvas));
canvas.SaveAs(Server.MapPath("Canvas_DrawPoly_89.png"));
```
```

[Visual Basic]

``````Dim canvas As New Canvas(250, 250)
canvas.PaintColor = New XColor(Color.Red)
canvas.PenColor = New XColor(Color.Red)
Dim points As XPoint() = New XPoint(126) {}
For i As Integer = 0 To 126
Dim x As Double = (100 * Math.Cos(i / 20.0R)) + 125
Dim y As Double = (100 * Math.Sin(i / 20.0R)) + 125
points(i) = New XPoint(x, y)
Next
canvas.DrawPoly(points, New DrawOptions(canvas))
canvas.SaveAs(Server.MapPath("Canvas_DrawPoly_89.png"))
```
```

Canvas_DrawPoly_89.png