Table of Contents

Method DrawFilledQuadrilateral

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

DrawFilledQuadrilateral(Quadrilateral, Color32, Color32, double)

Fills the interior of the specified quadrilateral and then draws its outline, using a solid fill color and a solid stroke color with the given thickness.

public Canvas DrawFilledQuadrilateral(Quadrilateral quad, Color32 fillColor, Color32 strokeColor, double strokeThickness = 1)

Parameters

quad Quadrilateral

The four-cornered polygon to fill and outline.

fillColor Color32

The interior fill color.

strokeColor Color32

The outline stroke color.

strokeThickness double

The stroke thickness in pixels. Must be greater than zero. Defaults to 1.

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var quad = new Quadrilateral(
    new Point(50, 10), new Point(250, 10),
    new Point(280, 110), new Point(20, 110));
var canvas = new Canvas(image);
canvas.DrawFilledQuadrilateral(
    quad,
    fillColor: new Color32(200, 255, 200),
    strokeColor: new Color32(0, 100, 0),
    strokeThickness: 2);

Exceptions

ArgumentNullException

Thrown if quad is null.

ArgumentOutOfRangeException

Thrown if strokeThickness is less than or equal to zero.

DrawFilledQuadrilateral(Quadrilateral, Brush, Pen)

Fills the interior of the specified quadrilateral and then draws its outline, using the given brush and pen.

public Canvas DrawFilledQuadrilateral(Quadrilateral quad, Brush brush, Pen pen)

Parameters

quad Quadrilateral

The four-cornered polygon to fill and outline.

brush Brush

The brush that defines the fill color.

pen Pen

The pen that defines the stroke color, thickness, line join, line cap, miter limit, and alignment.

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var quad = new Quadrilateral(
    new Point(50, 10), new Point(250, 10),
    new Point(280, 110), new Point(20, 110));
var brush = new Brush(new Color32(200, 255, 200));
var pen = new Pen(new Color32(0, 100, 0), 2)
{
    LineJoin = LineJoin.Bevel,
    Alignment = PenAlignment.Outside
};
var canvas = new Canvas(image);
canvas.DrawFilledQuadrilateral(quad, brush, pen);

Exceptions

ArgumentNullException

Thrown if quad, brush, or pen is null.