Method DrawLines
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
pointsIReadOnlyList<Point>The ordered vertices of the polyline. At least 2 are required.
colorColor32The line color.
thicknessdoubleThe line thickness in pixels. Must be greater than zero. Defaults to 1.
Returns
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
pointsis 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
pointsIReadOnlyList<Point>The ordered vertices of the polyline. At least 2 are required.
penPenThe pen that defines the stroke color, thickness, line join, line cap, and alignment.
Returns
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
pointsorpenis null.