Jump to content
Dany Marmur

A bit confused about SVG

Recommended Posts

I have put a lot of icons into my latest project. All SVG.


ATM i use DevExpress TcxImageList. In their documentation they state that i should create one TcxImageList per possible DPI.

In the same sentence they state that "you can also use vector images as icons".


It is not explicitly stated, but it seems that when loading SVG images into the TcxImageList, basing my form on their base class, these would be rescaled runtime.

In the https://github.com/EtheaDev/SVGIconImageList i see this stated clearly for the first time.


I skipped Rio, so the introduction of TVirtualImageList, erm... well. Other thing on the plate.


Am i right in assuming that we (Delphi devs, >= 10.3) now have the option of:

1. Storing image lists with a base pixel size to match possible DPI's (faster).

2. Storing the SVG and let code rasterize them run-time (slower).


In a modern desktop application - many many icons!

And testing/measuring between these two approaches seems very tedious.


So that was some ruminations re the bigger picture.


Would i benefit using TVirtualImageList / TSVGVirtualImageList even though DevExpress own image list isn't compatible?

Another boon would be to be able to use image name instead of indices. Is there a index-to-name conversion thingy?


This applications distribution needs (and this is my clients' needs, nothing i can change) dictates one PE (portable install).

This caters for a rather big exe (80 MB) but UI flow (speed) is also important.

Another thing is the time it takes me to manage the icons. I have some contrains like the fact the DevExpress barmanager/ribbon only accepts one list, this forces med to duplicate icons.

Share this post

Link to post
48 minutes ago, Dany Marmur said:

the DevExpress barmanager/ribbon only accepts one list, this forces med to duplicate icons.

You can only assign one imagelist at a time but if you've named your imagelist according to their instructions then they will switch between the different ones automatically.

If you're using SVG then you only need one imagelist.

  • Like 1

Share this post

Link to post

@Anders Melander, i meant that actions connected to the barmanager have a central imagelist. So if there are "commands" that should be reflected for example by icons in the LayoutControl i cannot use the same lists even though *some* of the icons are the same. It's a matter of "application intersection", hmm. I know about the Glyph property to override a specific image, but that does not help very much. This is mainly a miantainability concern, you change an icon in the barmanagers imagelist, it's not easy to figure out if you have to change some other icon in some other imagelist.


1 hour ago, Anders Melander said:

If you're using SVG then you only need one imagelist.

Thanks for the confirmation! Xlnt!

Share this post

Link to post
3 minutes ago, Lars Fosdal said:

Would you need to clone that SVG imagelist if you need to use different sizes of icons at the same time?

You don't need to but you can.

It's not really a SVG imagelist. It's an imagelist that also supports SVG meaning it can contain SVG, PNG, BMP, etc. This also mean that you can have one imagelist for low-res containing a mix of SVG and PNG and another for hi-res. I find that PNGs are often better for small (e.g. 16x16) low-res images.

  • Like 1
  • Thanks 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