[Lazarus] New Image Lists question

Ondrej Pokorny lazarus at kluug.net
Wed May 23 17:33:54 CEST 2018


On 23.05.2018 16:07, Vojtěch Čihák via Lazarus wrote:
> I have application where user can choose size of toolbars, i.e. I have several image lists named IL16, IL20, IL24, IL32, IL48 and I switch them in property TToolBar.Images. In meanwhile, TImageList was redesigned to work with hi-DPI desktops.
> Now, I can load more images to each imagelist, with suffix _150 and _200. But it will cause dupicities, because icon16_150 and icon16_200 will have size 24 and 32 respectively, which are already stored in IL24 and IL32.
>   
> Question is: how can I do it without duplicities?

You don't need several image lists any more. Delete IL20, IL24, IL32 and 
IL48 use only IL16 where you load all the images.

Read:
http://wiki.freepascal.org/Lazarus_1.10.0_release_notes#TCustomImageList_.2F_TImageList
http://wiki.freepascal.org/TImageList

Demos:
examples/imagelist_highdpi_designtime
examples/imagelist_highdpi_runtime

Ondrej


More information about the Lazarus mailing list