Graphics.DrawPolygon Method

Draws a polygon defined by an array of PointF structures.

Namespace: Aurigma.GraphicsMill.AdvancedDrawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void DrawPolygon(
	Pen pen,
	PointF[] points
)

Parameters

pen

Type: Aurigma.GraphicsMill.AdvancedDrawing.Pen

A Pen that determines the color, width, and style of the polygon.
points

Type: System.Drawing.PointF[]

An array of PointF structures that represent the vertices of the polygon.

Remarks

Polygon can be treated as closed polyline, where last point is connected with the first one.

To fill the polygon, use FillPolygon(Brush, PointF[]) method.

Examples

C#
using (var bitmap = new Bitmap(170, 160, PixelFormat.Format24bppRgb, RgbColor.White))
using (var graphics = bitmap.GetAdvancedGraphics())
{
    System.Drawing.PointF[] points = {
        new System.Drawing.PointF(5,  55),
        new System.Drawing.PointF(85, 5),
        new System.Drawing.PointF(165, 55),
        new System.Drawing.PointF(135, 153),
        new System.Drawing.PointF(35,  153)};
    graphics.DrawPolygon(new Pen(RgbColor.Blue), points);
    bitmap.Save(@"Images\Output\out.png");
}

See Also

Reference

Manual