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
|