SVGToBitmap Method

Returns a transparent bitmap drawn by Skia4Delphi library from a SVG source.

Unit: Olf.Skia.SVGToBitmap
function SVGToBitmap(const Width: integer; const Height: integer; const SVGSource: string; const BitmapScale: single = 1; const MarginTop: single = 0; const MarginRight: single = 0; const MarginBottom: single = 0; const MarginLeft: single = 0): TBitmap

Parameters

Width
Type: System.Integer

Logical width of the target bitmap. Its real width will be calculated ith the BitmapScale (in a FireMonkey project).

Height
Type: System.Integer

Logical height of the target bitmap. Its real height will be calculated ith the BitmapScale (in a FireMonkey project).

SVGSource
Type: System.string

XML source code of the SVG as string. No CSS content allowed. Check default Adobe Illustrator settings if you have exports problems.

BitmapScale
Type: System.Single

Only used in FireMonkey projects. The BitmapScale is used to calculate the real bitmap size from logical given size. Default value is 1.

MarginTop
Type: System.Single

Margin top used to calculate the real SVG size and position in the final bitmap. It's a decimal value between 0 and 100, used as a percent of the bitmap height.

MarginRight
Type: System.Single

Margin right used to calculate the real SVG size and position in the final bitmap. It's a decimal value between 0 and 100, used as a percent of the bitmap width.

MarginBottom
Type: System.Single

Margin bottom used to calculate the real SVG size and position in the final bitmap. It's a decimal value between 0 and 100, used as a percent of the bitmap height.

MarginLeft
Type: System.Single

Margin left used to calculate the real SVG size and position in the final bitmap. It's a decimal value between 0 and 100, used as a percent of the bitmap width.

Return Value

Type: TBitmap