Table of Contents

Class SvgFilter

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

A filter, in the coordinates of the node it filters: the filter elements and CSS filter functions of its filter property, run one after the other.

public sealed record SvgFilter : IEquatable<SvgFilter>
Inheritance
SvgFilter
Implements
Inherited Members

Examples

// The resolved tree: groups, paths with their paints and strokes, images; styles applied and units in pixels.
static void Walk(SvgNode node, int depth)
{
    string what = node switch
    {
        SvgPath path => $"path {path.Path.Bounds} fill {path.Fill}",
        SvgGroup group => $"group of {group.Children.Count}",
        SvgImage image => $"image {image.Destination}",
        _ => node.GetType().Name,
    };
    Console.WriteLine($"{new string(' ', depth * 2)}{node.Id} {what} opacity {node.Opacity}");
    if (node is SvgGroup g)
    {
        foreach (SvgNode child in g.Children)
        {
            Walk(child, depth + 1);
        }
    }
}

Walk(document.RenderTree, 0);

Properties

Region

Gets the union of the filters' regions, in the filtered node's coordinates: nothing outside it is drawn.

public RectF Region { get; init; }

Property Value

RectF