API Reference
SvgRasterizer
Provides deterministic, dependency-free rasterization of SVG documents.
Inheritance
- Object
- SvgRasterizer
Methods
public static SvgRasterizationResult Rasterize(String svg, Int32? width = null, Int32? height = null, Boolean strict = false) #SvgRasterizationResultRasterizes SVG and reports encountered unsupported content. Strict mode rejects output with diagnostics.
Parameters
- svg System.String
- The SVG document.
- width System.Int32? = null
- Optional output width.
- height System.Int32? = null
- Optional output height.
- strict System.Boolean = false
- Whether to throw instead of returning pixels when loss diagnostics are present.
Returns
Pixels and bounded diagnostics for the supported SVG subset.
public static RgbaImage ToImage(String svg, Int32? width = null, Int32? height = null) #RgbaImageRasterizes an SVG document to RGBA pixels using its declared viewport size or optional output dimensions. Use this instead of SvgRasterizer.ToPng when the pixels go straight into a composition, so they are not encoded and decoded on the way.
Parameters
- svg System.String
- width System.Int32? = null
- height System.Int32? = null
public static RgbaImage ToImage(Byte[] svgBytes, Int32? width = null, Int32? height = null) #RgbaImageRasterizes UTF-8 SVG bytes to RGBA pixels.
Parameters
- svgBytes System.Byte[]
- width System.Int32? = null
- height System.Int32? = null
public static Byte[] ToPng(String svg, RasterImageOptions? options = null) #Byte[]Rasterizes an SVG document to PNG using its declared viewport size.
Parameters
- svg System.String
- options ChartForgeX.Core.RasterImageOptions? = null
public static Byte[] ToPng(String svg, Int32? width, Int32? height, RasterImageOptions? options = null) #Byte[]Rasterizes an SVG document to PNG using optional output dimensions.
Parameters
- svg System.String
- width System.Int32?
- height System.Int32?
- options ChartForgeX.Core.RasterImageOptions? = null
public static Byte[] ToPng(Byte[] svgBytes, Int32? width = null, Int32? height = null, RasterImageOptions? options = null) #Byte[]Rasterizes UTF-8 SVG bytes to PNG.
Parameters
- svgBytes System.Byte[]
- width System.Int32? = null
- height System.Int32? = null
- options ChartForgeX.Core.RasterImageOptions? = null
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?