Enum ClipOp
Whether a clip keeps what is inside a shape or what is outside it.
public enum ClipOp
Fields
Difference = 1Drawing stays inside the clip so far but outside the shape.
Intersect = 0Drawing stays inside the shape and the clip so far.
Examples
// Clips are antialiased and last until the matching Restore.
canvas.Save();
canvas.ClipPath(Path.Circle(new Vector2(100, 100), 80));
canvas.ClipRect(new RectF(60, 60, 80, 80), ClipOp.Difference); // a square hole
canvas.DrawPaint(new Rgba8(30, 90, 200, 255)); // fills the whole clip
canvas.Restore();
// Only whole pixels inside the clip are drawn after a pixel-aligned rectangle clip, at no extra cost.
canvas.ClipRect(new RectF(0, 0, 100, 200));
canvas.FillCircle(new Vector2(100, 190), 40, Rgba8.Black);