Table of Contents

Enum LineCap

Namespace
Egami.Drawing
Assembly
Egami.Drawing.dll

How the ends of an open stroked contour look.

public enum LineCap

Fields

Butt = 0

The stroke stops square at the end point. The default, as in SVG, PDF and Skia.

Round = 1

A half circle of the stroke's width goes past the end point.

Square = 2

The stroke goes on past the end point by half its width, ending square.

Examples

// The pen is data: width, caps, joins and miter limit. Width 1, butt caps and miter joins by default.
Stroke thick = new(12) { Cap = LineCap.Round, Join = LineJoin.Round };
canvas.DrawLine(new Vector2(20, 20), new Vector2(280, 20), thick, new Rgba8(30, 90, 200, 255));

Path zigzag = Path.Polygon([new(20, 120), new(80, 60), new(140, 120), new(200, 60), new(260, 120)], close: false);
canvas.StrokePath(zigzag, new Stroke(8) { Join = LineJoin.Miter, MiterLimit = 4 }, Rgba8.Black);

// A hairline is one device pixel wide whatever the transform.
canvas.StrokeCircle(new Vector2(150, 160), 30, Stroke.Hairline, Rgba8.Red);