Table of Contents

Class SvgClip

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

A clip path, in the coordinates of the node it clips: the union of its shapes, each with its own clip-rule.

public sealed record SvgClip : IEquatable<SvgClip>
Inheritance
SvgClip
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

SvgClip(Path)

Initializes a new instance of the SvgClip class.

public SvgClip(Path path)

Parameters

path Path

The clip geometry: the union of the clip path's shapes, in the clipped node's coordinates.

Properties

Content

Gets the clip path's own content when it cannot be one path (text, or shapes clipped on their own), drawn as an alpha mask; or null.

public SvgGroup? Content { get; init; }

Property Value

SvgGroup

Path

Gets the clip geometry, in the clipped node's coordinates.

public Path Path { get; init; }

Property Value

Path