Table of Contents

Method DrawLines

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

DrawLines(IReadOnlyList<Point>, Color32, double)

Draws connected line segments (an open polyline) with a solid color and thickness. Proper joins are rendered at interior vertices and caps at endpoints.

public Canvas DrawLines(IReadOnlyList<Point> points, Color32 color, double thickness = 1)

Parameters

points IReadOnlyList<Point>

The ordered vertices of the polyline. At least 2 are required.

color Color32

The line color.

thickness double

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

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var canvas = new Canvas(image);
canvas.DrawLines(
    new[] { new Point(10, 10), new Point(100, 50), new Point(200, 10) },
    new Color32(0, 0, 255),
    thickness: 2);

Exceptions

ArgumentNullException

Thrown if points is null.

DrawLines(IReadOnlyList<Point>, Pen)

Draws connected line segments (an open polyline) using the given pen. Proper joins are rendered at interior vertices and caps at endpoints.

public Canvas DrawLines(IReadOnlyList<Point> points, Pen pen)

Parameters

points IReadOnlyList<Point>

The ordered vertices of the polyline. At least 2 are required.

pen Pen

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

Returns

Canvas

This Canvas instance for fluent chaining.

Examples

var pen = new Pen(new Color32(0, 0, 255), 3) { LineJoin = LineJoin.Round };
var canvas = new Canvas(image);
canvas.DrawLines(
    new[] { new Point(10, 10), new Point(100, 50), new Point(200, 10) },
    pen);

Exceptions

ArgumentNullException

Thrown if points or pen is null.