Forum > LCL

[Solved] Images on MainMenu with hi-res monitors

<< < (2/2)

This is 350%. This would correspond to an image size of 56x56. Such images are hard to find...

Two ideas: Maybe you are lucky to find 64x64 images. In this case you could add this size to the imagelist, too. You could drop the 32x32 images, but maybe add 16x16 if scaledown by such a large factor would result in a quality loss. With the 64x64 size, the images in your user's toolbar will probably be a bit too large. Test it. Or you could add also the resolution 56 to the image list and let it do the work to scale the 64x64 down to 56x56.

IIRC, all these intermediate images are stored in the lfm file and this will increase the size of the binary...

Alternatively you could search the forum for the "svg imagelist" implemented by the BGRA team. IIRC, this kind of image list accepts vector images and calculates the size needed upon request. Requires some rework of your project, though...

If I have 2 resolutions in my imagelist, 16 and 64, will Lazarus figure out the best image to use when someone has 120 PPI? How will it choose?

I am not sure. I had always thought that it only selects the next predefined image size for the current resolution. But now I did an experiment with sizes 16 and 64 only, and it seemed to me that the images are always scaled correctly. However, I can only test up to 150%. And I have Win11 now, maybe this makes a difference - I don't know...

If intermediate resolutions are not handled correctly you should add them to the image list as well (16, 20, 24, 32, 48, 64). As I wrote it is enough to add only 64x64 images, and maybe 16x16.

I'll go with just 16 and 64. Thanks for all your help.

I've added two resolutions for each menu item: 16 x 16 and also 56 x 56. They just don't look good at all. There must be a way to get them clearer. These three pictures should tell the story. On the ImageList Editor, I would:

* Click "Add more resolutions"
* Select the lo and hi res picturesIt seems to me that Lazarus is stretching the pixels in the lo res picture to the desired size on my users hi-res monitor.


[0] Message Index

[*] Previous page

Go to full version