SvgDecoder

constructor(source: ImageSource, options: Options, useViewBoundsAsIntrinsicSize: Boolean = true, renderToBitmap: Boolean = true, scaleToDensity: Boolean = false)


constructor(source: ImageSource, options: Options, parser: Svg.Parser = Svg.Parser.DEFAULT, density: PlatformContext.() -> Float = NO_DENSITY, useViewBoundsAsIntrinsicSize: Boolean = true, renderToBitmap: Boolean = true)

Parameters

parser

An Svg.Parser that converts bytes into an Svg. This property can be used to replace the default SVG parser with a different library.

density

A function whose return value will be used to scale the output dimensions of the image if the target size is Size.ORIGINAL.

useViewBoundsAsIntrinsicSize

If true, uses the SVG's view bounds as the intrinsic size for the SVG. If false, uses the SVG's width/height as the intrinsic size for the SVG.

renderToBitmap

If true, renders the SVG to a bitmap immediately after decoding. Else, the SVG will be rendered at draw time. Rendering at draw time is more memory efficient, but depending on the complexity of the SVG, can be slow.