Table of Contents

Class SvgMask

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

A mask, in the coordinates of the node it masks: content drawn into a region, used by luminance or alpha.

public sealed record SvgMask : IEquatable<SvgMask>
Inheritance
SvgMask
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);

Constructors

SvgMask(SvgGroup)

Initializes a new instance of the SvgMask class.

public SvgMask(SvgGroup content)

Parameters

content SvgGroup

The mask's content.

Properties

Content

Gets the mask's content, in the masked node's coordinates.

public SvgGroup Content { get; init; }

Property Value

SvgGroup

Kind

Gets whether the mask uses its content's luminance (the default) or alpha (mask-type).

public SoftMaskKind Kind { get; init; }

Property Value

SoftMaskKind

Mask

Gets a mask on the mask itself, or null.

public SvgMask? Mask { get; init; }

Property Value

SvgMask

Region

Gets the mask region outside which the mask is zero, in the masked node's coordinates.

public RectF Region { get; init; }

Property Value

RectF