Click or drag to resize

DrawingUtilitiesPixelsFromSvg Method (String, Int32, Int32, Boolean, Color, Boolean)

Get array of bytes that represent RGBA values for an image of a given size created from SVG

Namespace:  Rhino.UI
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 8.0
Syntax
public static byte[] PixelsFromSvg(
	string svg,
	int width,
	int height,
	bool premultiplyAlpha,
	Color backgroundColor,
	bool adjustForDarkMode
)

Parameters

svg
Type: SystemString
A valid svg string
width
Type: SystemInt32
Width of the svg in pixels
height
Type: SystemInt32
Height of the svg in pixels
premultiplyAlpha
Type: SystemBoolean
Pre-lends the background color with the pixels based on their alpha value
backgroundColor
Type: System.DrawingColor
Background color - pass Color.Empty if you don't know what to pass.
adjustForDarkMode
Type: SystemBoolean
If true swaps any available attributes for their dark mode counterparts>

Return Value

Type: Byte
Null on an exception, an array of Color as bytes otherwise
See Also