Ondrej, you implemented scaling of the images used for the toolbar and menu of the IDE. Where can I find these methods? Are they available for standard imagelists for non-IDE usage?
Mailing lists / lazarus / 2017-07
Scaling of toolbar icons
3 messages · 2 people · –
- WWerner Pamler 2
- OOndrej Pokorny 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Werner Pamler wroteOndrej, you implemented scaling of the images used for the toolbar and menu of the IDE. Where can I find these methods?
IDEImagesIntf.pas
Are they available for standard imagelists for non-IDE usage?
No, the current solution is Lazarus specific. (It doesn't make sense to have IDEImagesIntf.pas in LCL.) You can use a similar approach for your applications, though.
Ondrej
Ondrej Pokorny wrote 11 lines
Thanks. I have the idea of writing a "TScaledImageList" which needs up to three imagelists with different resolutions. It will calculate the required image size from its BaseWidth/BaseHeight and BasePixelsPerInch settings and the current PixelsPerInch. If the requested image size matches one of the linked image lists it will copy these images to itself. If the image size does not match it will create stretchdrawn images from those with the closest size. The ScaledImageList is the imagelist linked to form components, such as TListView or TTreeView. I did not start any coding, yet, but I think it should work and should greatly facilitate using scaled images at the application level.
