Graphics.FillPolygon Method

Fills the interior of a polygon defined by an array of PointF structures.

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

Syntax

C#
public void FillPolygon(
	Brush brush,
	PointF[] points
)

Parameters

brush

Type: Aurigma.GraphicsMill.AdvancedDrawing.Brush

A Brush that determines the characteristics of the fill.
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 draw an outlined polygon, use DrawPolygon(Pen, 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