SVGToBitmap Method
Definition
Returns a transparent bitmap drawn by Skia4Delphi library from a SVG source.
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
- Integer
Logical width of the target bitmap. Its real width will be calculated ith the BitmapScale (in a FireMonkey project).
- Height
- Integer
Logical height of the target bitmap. Its real height will be calculated ith the BitmapScale (in a FireMonkey project).
- SVGSource
- string
XML source code of the SVG as string. No CSS content allowed. Check default Adobe Illustrator settings if you have exports problems.
- BitmapScale
- 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
- 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
- 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
- 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
- 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.