Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: AlexTP on December 20, 2018, 06:52:34 pm

Title: [Solved] How to paint SVG file on canvas?
Post by: AlexTP on December 20, 2018, 06:52:34 pm
For ex, I have SVG file or StringList with its text. I want to paint it on canvas at (x,y) with given sizes (nx,ny).
How to do it?
Title: Re: How to paint SVG file on canvas?
Post by: mr-highball on December 20, 2018, 06:59:13 pm
bgrabitmap would probably be what you want: https://github.com/bgrabitmap/bgrabitmap

(load from stream/file)
https://github.com/bgrabitmap/bgrabitmap/blob/ecdea28344839d2cae597c6ca4e90c29bf692eba/bgrabitmap/bgrasvg.pas#L139

there's a Draw method which works with a TBGRACanvas2D, but the canvas probably has some "ToBitmap" method or the like
Title: Re: [Solved] How to paint SVG file on canvas?
Post by: lucamar on December 20, 2018, 07:56:53 pm
A list of libraries with SVG reading/writing/rendering, taken from the wiki page: Graphics libraries (http://wiki.freepascal.org/Graphics_libraries)
Also, from FPC Package list (http://wiki.freepascal.org/Package_List)

And I'm sure there are more somewhere out there :)
TinyPortal © 2005-2018