Jump to content

Looking for SVG support in Delphi?

Recommended Posts

Posted (edited)

In an earlier thread I presented an Interface-based access to native Windows (Direct2D) SVG support for Delphi applications.  This has now been integrated into the SVGIconImageList components by @Carlo Barazzetta.  Carlo is a kind of master of ImageLists (among other things).  Have a look at his IconFontsImageList for instance. His SVGIconImageList component was based on the work of Martin Walter who must be a great programmer.  His SVG component covered almost every SVG element and was well structured and cleanly written.  There were numerous bugs and issues though, which, to a large extent, were fixed over the last few weeks and the code was refactored and optimized.  Finally, @Vincent Parrett contributed a virtual version of the Image List, mirroring Delphi's VirtualImageList.


So in its current form the component features:

  • An SVGImageCollection component that inherits from Delphi's CustomImageCollection and thus is compatible with VirtualImageList
  • A choice of SVG engines:  the pascal one based on Martin's work which is using GDI+ and the native Windows one which is using Direct2D.
  • Other SVG engines can be plugged-in with minimum effort.
  • Excellent design support with a nice and effective SVGImageCollection editor developed by Carlo and the built-in VirtualImageList editor.
  • Support for changing the opacity and color of the SVGs including using GrayScale.  If you adopt  Material Design for example and you use VCL styles, you can adjust the icon color to the style.
  • Compatibility with older Delphi versions going back to XE6.
  • It is free and open-source


Svgs are vastly superior to bitmaps because they are typically tiny text files and scale perfectly.  So, you do not need to ship with your application multiple resolutions of your images to match the DPI of the monitors.  And there is a vast number of free SVGs to cover most needs.  IMHO the combination of SVGImageCollection with Delphi's VirtualImageList is the best available solution (commercial ones included) for building DPI-aware Windows applications.  Give it a try.

Edited by pyscripter
  • Like 13
  • Thanks 6

Share this post

Link to post

Animation is not simple, I can only imagine the amount of work required to implement animation - and that's not really the intended direction for SVGIconImageList - as you can tell from the name of the library, it's about using svg with imagelists. 

  • Thanks 1

Share this post

Link to post

I want to personally thank Vincent Parrett and Kyriakos Vlahos for the great contribution to the project!
The official 2.0 version will be released shortly and also published on GetIt.
Meanwhile, you can download the project from Github and report any problems.

I'm also working on IconFontsImageList to add similar funcionalities, like a IconFontsVirtualImageList and IconFontsImageCollection...

  • Like 5
  • Thanks 2

Share this post

Link to post

@Carlo Barazzetta Thank you! Your components are a must-have for High-DPI enabled applications. I would say High-DPI is a second revolution in Delphi desktop development after Unicode.

  • Like 1

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now