Table of Contents

Class SvgResolvers

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

Ready resolvers for Resolver.

public static class SvgResolvers
Inheritance
SvgResolvers
Inherited Members

Examples

// Images, style sheets and fonts the file refers to open only through a resolver; data: URIs always work.
var options = new SvgLoadOptions
{
    Resolver = SvgResolvers.SameDirectory(folder),
    Dpi = 96,
    Context = EgamiContext.Default with { Limits = SafetyLimits.Default with { MaxTotalBytes = 64L << 20 } },
};
SvgDocument document = SvgDocument.Parse(Icon, options);

Methods

SameDirectory(string)

A resolver that opens files at or below one folder and nothing else: no other folders, no network, no file whose link points outside the folder.

public static Func<Uri, Stream?> SameDirectory(string folder)

Parameters

folder string

The folder, usually the SVG file's own.

Returns

Func<Uri, Stream>

The resolver.