Class SvgDecodeOptions
Options for reading SVG through SvgFormat with Raster.Load and Raster.Probe.
public sealed record SvgDecodeOptions : ReaderOptions, IEquatable<ReaderOptions>, IEquatable<SvgDecodeOptions>
- Inheritance
-
SvgDecodeOptions
- Implements
- Inherited Members
Examples
// SVG as an Egami format: Raster.Load draws a file at its own size, Raster.Probe reads the size without drawing.
EgamiContext context = EgamiContext.Default.WithFormat(SvgFormat.Info);
RasterInfo info = Raster.Probe(path, context);
using Raster<Rgba8> icon = Raster.Load<Rgba8>(path, context);
// Twice the size, for a high-density screen.
using Raster<Rgba8> sharp = Raster.Load<Rgba8>(path, context, new SvgDecodeOptions { Scale = 2 });
Properties
Scale
Gets how many raster pixels each of the document's pixels becomes: 2 draws an icon at twice its size. The raster is the document's size times this, rounded up. Defaults to 1.
public float Scale { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not positive and finite.