Table of Contents

Enum PathOp

Namespace
Egami.Drawing
Assembly
Egami.Drawing.dll

How Op(Path, PathOp, float) and Combine(IEnumerable<Path>, PathOp, float) combine the areas of two paths: Skia's five operations.

public enum PathOp

Fields

Difference = 0

The first area without the second.

Intersect = 1

Where both areas are.

ReverseDifference = 4

The second area without the first.

Union = 2

Where either area is.

Xor = 3

Where exactly one of the areas is.

Examples

// A frame: one round rectangle cut out of another, kept as curves, so a PDF or SVG backend writes it exactly.
Path frame = Path.RoundRect(new RoundRect(new RectF(0, 0, 200, 140), 24))
    .Difference(Path.RoundRect(new RoundRect(new RectF(20, 20, 160, 100), 12)));

// Many shapes in one pass, applied left to right; overlaps and self-intersections removed; an area grown by 4 units.
Path dots = Path.Combine([Path.Circle(new Vector2(40, 40), 30), Path.Circle(new Vector2(80, 40), 30), Path.Circle(new Vector2(60, 75), 30)], PathOp.Union);
Path clean = Path.Star(new Vector2(50, 50), 45, 20, 5).Simplify();
Path halo = dots.Inflate(4, LineJoin.Round);