[Lazarus] Component icons howto ?

Michael Van Canneyt michael at freepascal.org
Wed Mar 30 09:57:07 CEST 2022



On Wed, 30 Mar 2022, Ondrej Pokorny via lazarus wrote:

> On 29.03.2022 19:45, Michael Van Canneyt via lazarus wrote:
>> On Tue, 29 Mar 2022, Werner Pamler wrote:
>>> I don't know the actual procedure names ATM, but imagine that when the 
>>> message window needs a "warning" icon (which is - say - 12x12 at 96ppi) 
>>> then the scaling procedure at 192ppi only needs to look for 
>>> "warning_200.png". If the exact image size would have been included in the 
>>> file name instead ("warning_24x24.png"), it would have to know the size of 
>>> the base image at 96ppi in order to select the right image. A little 
>>> simplification.
>> 
>> I fail to see the link between 192 and 200. This requires people to know
>> that 96dpi and 144 dpi and 192 dpi are 100, 150 and 200 % of a standard 
>> size.
>
> Forget about the DPI/PPI values. What you need is the %-scaling factor of the 
> original size.

Why do you think I know this is a scaling factor ?

I didn't have a clue until Werner explained.

Sorry, you can argue all you like, but if I see a list of icon files xyz_24x24.png 
then I know *exactly* what to create, just from the filenames. 
No need to do math, open file whatnot.

With your method, I need to open the file (unless I know standard size is
24), check the size, and then possibly multiply (if I know that the suffix
is the scaling factor in %).

As it was, I actually opened 3 files to see what the needed sizes were.

By contrast, if I need to create icons for a Linux app I check e.g:

> ls /usr/share/icons/gnome/
128x128/  16x16/  22x22/  24x24/  256x256/  32x32/  48x48/  512x512/  64x64/  8x8/  icon-theme.cache  index.theme  scalable/

and I know exactly what to create, just from the names.

If you think that your method is easier, we have very different concepts of what is 'easy'.

Clearly, I would not be asking these questions if it was so obvious.

Michael.


More information about the lazarus mailing list