Table of Contents

Method FillPolygon

Namespace
LMKit.Graphics.Drawing
Assembly
LM-Kit.NET.dll

FillPolygon(Polygon, Color32)

Fills the interior of the specified polygon with a solid color using the even-odd fill rule.

public Canvas FillPolygon(Polygon polygon, Color32 color)

Parameters

polygon Polygon

The polygon to fill.

color Color32

The fill color.

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var triangle = Polygon.Regular(new Point(100, 100), 50, 3);
var canvas = new Canvas(image);
canvas.FillPolygon(triangle, new Color32(0, 180, 0));

Exceptions

ArgumentNullException

Thrown if polygon is null.

FillPolygon(Polygon, Brush)

Fills the interior of the specified polygon using the given brush and the even-odd fill rule.

public Canvas FillPolygon(Polygon polygon, Brush brush)

Parameters

polygon Polygon

The polygon to fill.

brush Brush

The brush that defines the fill color.

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var hexagon = Polygon.Regular(new Point(200, 200), 80, 6);
var brush = new Brush(new Color32(0, 180, 0));
var canvas = new Canvas(image);
canvas.FillPolygon(hexagon, brush);

Exceptions

ArgumentNullException

Thrown if polygon or brush is null.