Class SvgRenderOptions
How Rasterize<TPixel>(SvgRenderOptions?) and Draw(Canvas, RectF?, SvgRenderOptions?) draw a document.
public sealed record SvgRenderOptions : IEquatable<SvgRenderOptions>
- Inheritance
-
SvgRenderOptions
- Implements
- Inherited Members
Examples
// At the document's own size, scaled, or at a target width (the height keeps the aspect ratio).
using Raster<Rgba8> icon = document.Rasterize<Rgba8>();
using Raster<Rgba8> large = document.Rasterize<Rgba8>(new SvgRenderOptions { Width = 512 });
using Raster<Rgba8> onWhite = document.Rasterize<Rgba8>(new SvgRenderOptions { Scale = 2, Background = new RgbaF32(1, 1, 1, 1) });
Properties
Background
Gets the color the raster starts with; transparent by default.
public RgbaF32 Background { get; init; }
Property Value
CanvasOptions
Gets the options of the raster canvas Rasterize<TPixel>(SvgRenderOptions?) draws on, or null for the defaults.
public CanvasOptions? CanvasOptions { get; init; }
Property Value
Context
Gets the context of the raster Rasterize<TPixel>(SvgRenderOptions?) creates, for its limits and memory; or null for the document's.
public EgamiContext? Context { get; init; }
Property Value
Default
Gets the defaults: the document's own size, transparent, no text as paths.
public static SvgRenderOptions Default { get; }
Property Value
FilterScale
Gets the resolution factor a filtered group is rasterized at on a vector backend, times the device scale; 1 by default. On a raster canvas filters run at device scale.
public float FilterScale { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not positive and finite.
Height
Gets the height of the raster in pixels, or null to take it from Width and the document's aspect ratio, or from its size times Scale. With both set, the document is stretched to fill.
public int? Height { get; init; }
Property Value
- int?
Exceptions
- ArgumentOutOfRangeException
The value is not positive.
Languages
Gets the reader's languages, most preferred first, for switch and systemLanguage (BCP 47 tags such as
en-US); English by default.
public IReadOnlyList<string> Languages { get; init; }
Property Value
Scale
public float Scale { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not positive and finite.
TextAsPaths
Gets a value indicating whether text is drawn as outlines instead of glyph runs, for callers that need paths, such as a plotter or a cutter. On a raster both look the same; a PDF or SVG backend then holds no selectable text.
public bool TextAsPaths { get; init; }
Property Value
Width
Gets the width of the raster in pixels, or null to take it from Height and the document's aspect ratio, or from its size times Scale.
public int? Width { get; init; }
Property Value
- int?
Exceptions
- ArgumentOutOfRangeException
The value is not positive.