EtheaDev / SVGIconImageList

Three engines to render SVG (Delphi Image32, Skia4Delphi, Direct2D wrapper) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...)
Apache License 2.0
321 stars 93 forks source link
delphi dpi draw-icons fmx fmx-component icons imagelist svg svg-icons svg-images vcl vcl-components vcl-fmx virtualimagelist

# SVGIconImageList License

Three engines to render SVG (Delphi Image32, Skia4Delphi, Direct2D wrapper) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...)

Actual official version 4.1.9 (VCL+FMX)

Component Description
SVGIconImageCollectionComponentIcon.png TSVGIconImageCollection is collection of SVG Images for Delphi to provide a centralized list of images for SVGIconVirtualImageLists (only for VCL)
SVGIconVirtualImageListComponentIcon.png TSVGIconVirtualImageList is a special "virtual" ImageList for Delphi linked to an SVGIconImageCollection (only for VCL) to simplify use of SVG Icons (resize, opacity, grayscale and more...)
SVGIconImageComponentIcon.png TSVGIconImage is an extended Image component for Delphi (VCL+FMX) to show any SVG image directly or included into a an SVGIconImageList with all functionality (stretch, opacity, grayscale and more...)
SVGIconImageListComponentIcon.png TSVGIconImageList is an extended ImageList for Delphi (VCL+FMX) with an embedded SVG image collection: the VCL component is deprecated, we recommend to use SVGIconImageCollection + SVGIconVirtualImageList also for older Delphi versions!

Very important notice

WARNING: From version 4.0, TSVGIconVirtualImageList inherits from TVirtualImageList (using Delphi 10.3 to latest). For previous Delphi versions TSVGIconVirtualImageList inherits from TSVGIconImageListBase.

An important difference is that a TVirtualImageList may use and create only a subset of the images in the collection.

Although, the standard TVirtualImageList does not have the FixedColor, GrayScale, ApplyToRootOnly and Opacity properties, these properties exist at the TSVGIconImageCollection and they would be reflected on the linked TVirtualImageList, but if you change those properties at collection level, all the VirtualImageList linked changes!

For this reasons, now TSVGIconVirtualImageList have also FixedColor, GrayScale, ApplyToRootOnly and Opacity properties, so you can setup those properties only at VirtualImageList level, and you can share the same TSVGIconImageCollection from many VirtualImageList with different poperties, as you can see in the new SVGIconVirtualImageListDemo.

So, if you are using those components from Delphi 10.3, the recommended combination should be TSVGIconImageCollection + TSVGIconVirtualImageList.

Don't forget also the importance of PreserveItems when you have a large ImageCollection with many linked Actions. Without setting this property to "True", everytime you add or remove an icon in the collection, you have to check and change the ImageIndex of all the Actions.

Another feature available from Delphi 10.4 version, is that TSVGIconImageCollection inherits from TCustomImageCollection, so you can also use it with the TVirtualImage component and place SVG icons into the TControlList component, as explained here...

Choose your preferred SVG engine!

There are three implementation:

You can read more details here.

Performance comparison

This table shows the performance of the three rendering engines tested with SVGExplorer, using a significant amount of icons from different sets, rendered at 128x128 pixels.

Count Icon set Image32 D2D Skia4Delphi
997 Font-Awesome 1265ms 1453ms 1172ms
654 Papirus 2750ms(1) 937ms 1266ms(1)
5366 Material-Design 11015ms 12001ms 10688ms

As you can see, the three engines perform differently depending on the icons and their complexity.

(1)Notice that Image32 and Skia4Delphi are the only engines capable of rendering blur effect (that is always slow to calculate): this is the reason of "slow" performance to render Papirus icons that contains blur effect.

Available from Delphi XE3 to Delphi 12 (VCL and FMX Platforms)

Delphi 12 Support

Related links: embarcadero.com - learndelphi.org

Sample image of VCL version

Sample.jpg

Sample image of FMX (Windows) version

SampleFMX.jpg

Sample images of the VCL SVGText-property editor (VCL and FMX)

SVGTextPropertyEditor.jpg

SVGTextPropertyEditorFMX.jpg

UTILITIES

The SVG Viewer Demo is useful to check the rendering quality of the engines available.

The SVG Icon Explorer utility is useful to explore and preview your svg image collections.

You can use SVG Shell Extensions if you want to see your icons directly into Windows Explorer or you want to edit them using a powerful SVG Text Editor.

DOCUMENTATION

Follow the guide in Wiki section to known how to use those components to modernize your Delphi VCL or FMX Windows applications scalable, colored and beautiful with few lines of code.

Other similar library

A similar project made by Ethea for Icon Fonts: https://github.com/EtheaDev/IconFontsImageList

RELEASE NOTES

14 Sep 2024: version 4.1.9 (VCL+FMX)

27 Aug 2024: version 4.1.8 (VCL+FMX)

13 Aug 2024: version 4.1.7 (VCL+FMX)

18 Jul 2024: version 4.1.6 (VCL+FMX)

22 May 2024: version 4.1.5 (VCL+FMX)

05 May 2024: version 4.1.4 (VCL+FMX)

19 Apr 2024: version 4.1.3 (VCL+FMX)

08 Jan 2024: version 4.1.2 (VCL+FMX)

09 Nov 2023: version 4.1.1 (VCL+FMX)

03 Sep 2023: version 4.1.0 (VCL+FMX)

24 Aug 2023: version 4.0.0 (VCL+FMX)

28 Feb 2023: version 3.9.6 (VCL+FMX)

13 Jan 2023: version 3.9.5 (VCL+FMX)

23 Oct 2022: version 3.9.4 (VCL+FMX)

15 Sep 2022: version 3.9.3 (VCL+FMX)

28 Aug 2022: version 3.9.2 (VCL+FMX)

21 Jun 2022: version 3.9.1 (VCL+FMX)

08 May 2022: version 3.8.3 (VCL+FMX)

10 Apr 2022: version 3.8.2 (VCL+FMX)

29 Mar 2022: version 3.8.1 (VCL+FMX)

17 Mar 2022: version 3.8.0 (VCL+FMX)

09 Mar 2022: version 3.7.0 (VCL+FMX)

28 Feb 2022: version 3.6.0 (VCL + FMX)

26 Feb 2022: version 3.5.2 (VCL+FMX)

23 Feb 2022: version 3.5.1 (VCL+FMX)

19 Feb 2022: version 3.5.0 (VCL+FMX)

14 Feb 2022: version 3.4.0 (VCL+FMX)

13 Jan 2022: version 3.3.0 (VCL+FMX)

24 Nov 2021: version 3.2.0 (VCL+FMX)

05 Nov 2021: version 3.1.1 (VCL+FMX)

31 Oct 2021: version 3.1.0 (VCL+FMX)

28 Aug 2021: version 3.0.0 (VCL+FMX)

24 Aug 2021: version 2.5.0 (VCL+FMX)

22 Jul 2021: version 2.4.0 (VCL+FMX)

18 Jul 2021: version 2.3.1 (VCL+FMX)

17 Jul 2021: version 2.3.0 (VCL+FMX)

18 Apr 2021: version 2.2.6 (VCL+FMX)

22 Feb 2021: version 2.2.5 (VCL+FMX)

23 Jan 2021: version 2.2.4 (VCL+FMX)

17 Jan 2021: version 2.2.3 (VCL+FMX)

24 Dec 2020: version 2.2.2 (VCL+FMX)

08 Dec 2020: version 2.2.1 (VCL+FMX)

23 Sep 2020: version 2.2.0 (VCL+FMX)

16 Sep 2020: version 2.1.1 (VCL) 2.1.0 (FMX)

04 Sep 2020: version 2.1.0 (VCL) 1.5.1 (FMX)

26 Aug 2020: version 2.0 (VCL) 1.5.0 (FMX)

17 Aug 2020: version 1.9 (VCL+FMX)

13 Aug 2020: version 1.8 (VCL+FMX)

05 Aug 2020: version 1.7 (VCL+FMX)

15 July 2020: version 1.6 (VCL+FMX)

13 June 2020: versione 1.5 (VCL+FMX)

09 June 2020: versione 1.4 (VCL+FMX)

06 June 2020: version 1.3 (VCL+FMX)

28 May 2020: version 1.2 (VCL+FMX)

25 May 2020: version 1.1 (VCL+FMX)

24 May 2020: first version 1.0 (VCL)

THANKS TO

These components uses the followin libraries:

Many thanks to Vincent Parrett and Kiriakos Vlahos for their great contibution.