Unit Olf.Skia.SVGToBitmap

Description

***************************************************************************

Librairies pour Delphi

Copyright 1990-2024 Patrick Prémartin under AGPL 3.0 license.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

***************************************************************************

This repository contains functions, procedures and classes to use in Delphi projects (console, VCL, FireMonkey and others). It's my "everything reuseable things" toolbox.

The units to be used in your projects can be found in the "src" folder. Some features are explained on my blog or have been coded live on Twitch.

Examples of use in the form of VCL or FireMonkey projects are available in the "samples" subfolder.

***************************************************************************

Author(s) : Patrick PREMARTIN

Site : https://developpeur-pascal.fr/librairies-publiques.html

Project site : https://github.com/DeveloppeurPascal/librairies

*************************************************************************** File last update : 01/08/2024 10:47:00 Signature : 2e545670f696ebf375fed52e96432b79a3144f1c ***************************************************************************

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TOlfSVGBitmapList  

Functions and Procedures

function SVGToBitmap(Const Width, Height: integer; Const SVGSource: string; const MarginTop: single = 0; const MarginRight: single = 0; const MarginBottom: single = 0; const MarginLeft: single = 0): TBitmap;

Description

Functions and Procedures

function SVGToBitmap(Const Width, Height: integer; Const SVGSource: string; const MarginTop: single = 0; const MarginRight: single = 0; const MarginBottom: single = 0; const MarginLeft: single = 0): TBitmap;

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

Parameters
Width
Logical width of the target bitmap. Its real width will be calculated ith the BitmapScale (in a FireMonkey project).
Height
Logical height of the target bitmap. Its real height will be calculated ith the BitmapScale (in a FireMonkey project).
SVGSource
XML source code of the SVG as string. No CSS content allowed. Check default Adobe Illustrator settings if you have exports problems.
BitmapScale
Only used in FireMonkey projects. The BitmapScale is used to calculate the real bitmap size from logical given size. Default value is 1.
MarginTop
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
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
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
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.
My libraries for Delphi (c) 1990-2025 Patrick PREMARTIN - Powered by PasDoc
Generated by PasDoc 0.16.0.