Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-07

Scaling of toolbar icons

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Werner Pamler

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?

Reply by email

Ondrej Pokorny
to Werner Pamler
Werner Pamler wrote
Ondrej, 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

Reply by email

Werner Pamler
to Ondrej Pokorny
Ondrej Pokorny wrote 11 lines
On 09.07.2017 0:22, Werner Pamler via Lazarus wrote: > Ondrej, 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.

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.

Reply by email