Table of Contents

Enum BlurStyle

Namespace
Egami.Drawing
Assembly
Egami.Drawing.dll

How a MaskBlur keeps or removes the blurred shape's inside and outside, as Skia's blur styles.

public enum BlurStyle

Fields

Inner = 3

Keeps only the blur inside the shape: a soft inner edge.

Normal = 0

Blurs inside and out.

Outer = 2

Keeps only the blur outside the shape: a halo with a hole.

Solid = 1

Keeps the inside solid and blurs outward.

Examples

using (RasterCanvas<Rgba8> canvas = raster.CreateCanvas())
{
    // A soft-edged card (exact, from the error function) and a neon outline: the stroke's outer blur only, then the stroke.
    canvas.FillRoundRect(new RoundRect(new RectF(20, 20, 110, 80), 12), new SolidPaint(new Rgba8(30, 30, 30, 255)) { Blur = new MaskBlur(6) });
    Path ring = Path.Circle(new Vector2(220, 60), 40);
    canvas.StrokePath(ring, new Stroke(4), new SolidPaint(new Rgba8(255, 40, 200, 255)) { Blur = new MaskBlur(8, BlurStyle.Outer) });
    canvas.StrokePath(ring, new Stroke(4), new Rgba8(255, 200, 250, 255));
}