Table of Contents

Class SvgPath

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

A shape: a 2.6 Path with its fill, stroke and markers.

public sealed record SvgPath : SvgNode, IEquatable<SvgNode>, IEquatable<SvgPath>
Inheritance
SvgPath
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

SvgPath(Path)

Initializes a new instance of the SvgPath class.

public SvgPath(Path path)

Parameters

path Path

The geometry, in this node's coordinates, with its fill rule.

Properties

Antialias

Gets a value indicating whether edges are antialiased (shape-rendering other than crispEdges).

public bool Antialias { get; init; }

Property Value

bool

Fill

Gets the fill, with fill-opacity applied, or null for none.

public Paint? Fill { get; init; }

Property Value

Paint

Markers

Gets the markers placed on the shape, or null.

public SvgGroup? Markers { get; init; }

Property Value

SvgGroup

NonScalingStroke

Gets a value indicating whether the stroke is drawn in device pixels (vector-effect: non-scaling-stroke).

public bool NonScalingStroke { get; init; }

Property Value

bool

PaintOrder

Gets the order the fill, stroke and markers are painted in.

public SvgPaintOrder PaintOrder { get; init; }

Property Value

SvgPaintOrder

Path

Gets the geometry, in this node's coordinates; its FillRule is the shape's fill-rule.

public Path Path { get; init; }

Property Value

Path

Stroke

Gets the stroke geometry (width, caps, joins, dashes), or null when there is no stroke.

public Stroke? Stroke { get; init; }

Property Value

Stroke

StrokePaint

Gets the stroke paint, with stroke-opacity applied, or null for none.

public Paint? StrokePaint { get; init; }

Property Value

Paint