tray icons usage Topic is solved
-
- Posts: 140
- Joined: 28 Oct 2020, 02:58
tray icons usage
hello. i was reaading on the usage of tray icons in ahk v2 but some things remain unclear to me.
1. it seems as though the .ico format is most desired. does it have any advantages??
2. are there recommendations for icon size / resolution ??
3. is it possible to, say, put a rectangular icon and have it be displayed as a rectangle ?? (because most icons seem to have filled an area in a square)
thanks in advance
1. it seems as though the .ico format is most desired. does it have any advantages??
2. are there recommendations for icon size / resolution ??
3. is it possible to, say, put a rectangular icon and have it be displayed as a rectangle ?? (because most icons seem to have filled an area in a square)
thanks in advance
Re: tray icons usage
Hello,
These seem to be questions about how Windows uses icons, rather than anything to do with AHK. I'm not an icon expert but can offer the following comments. Icon files use a specialized format that may contain not just one image but a set of related images of various sizes, integrated into a single file. Although an icon file need not always have multiple images, advantages may occur.
If you work with an icon editor, you can quickly see all of these options and get your icon ready to use.
These seem to be questions about how Windows uses icons, rather than anything to do with AHK. I'm not an icon expert but can offer the following comments. Icon files use a specialized format that may contain not just one image but a set of related images of various sizes, integrated into a single file. Although an icon file need not always have multiple images, advantages may occur.
- A "best fit" may be selected for the display's resolution or the specific use of the icon.
- Other images in the file may be used in other circumstances. These may be similar or different.
- The icon file may accommodate programs that require a specific image size.
If you work with an icon editor, you can quickly see all of these options and get your icon ready to use.
Re: tray icons usage Topic is solved
My thoughts:
From the TraySetIcon documentation:marypoppins_1 wrote: ↑ 1. it seems as though the .ico format is most desired. does it have any advantages??
Slight distortion may occur when loading tray icons from file types other than .ICO. This is especially true for 16x16 icons. To prevent this, store the desired tray icon inside a .ICO file.
16x16 to be used without distorting the image. Larger images would lose their sharpness to be made to fit in the space.marypoppins_1 wrote: ↑ 2. are there recommendations for icon size / resolution ??
Not sure what you mean by “seem to have filled an area in a square”. I don’t believe it would change the aspect ratio to fill the square in both directions. I think it would leave it in your rectangular shape but just leave one of the dimensions unfilled. For example, if you had an image that was 16 pixels high and 32 pixels wide, I believe you are hoping it would fill the 16-pixel height and just make it take up 32 pixels horizontally. But it won’t make have it take up more than the allocated space in the tray for an icon, so I think it would shrink it by 50% in both directions so it would be 16 pixels wide and only take up 8 pixels of height (4 empty rows of pixels above and below it in the allocated space).marypoppins_1 wrote: ↑ 3. is it possible to, say, put a rectangular icon and have it be displayed as a rectangle ?? (because most icons seem to have filled an area in a square)
thanks in advance
-
- Posts: 140
- Joined: 28 Oct 2020, 02:58
Re: tray icons usage
okay, thank you mikey and boiler
Re: tray icons usage
Another argument for using .ICO files is that, if your script has any GUIs that appear, Windows will apply your custom icon to the GUI as well. The icon in the top corner will also be 16x16, but probably an icon will appear in the Windows Taskbar at the bottom, while the GUI window is open. The Taskbar image will likely be 32x32. I'm also not a Windows expert, but I make some of my own icons. Here is a recent one I did. I made the high-rez one, then converted it to ICO format. The conversion process automatically creates the different sizes, but the smaller ones are all blurry and terrible. So I edited the 16x16 one after conversion to give it crisp edges. It makes it look nicer in the System Tray.
And as Boiler indicated, if I wanted this to be a rectangle, I'd keep the same aspect ratio (square) but just "erase" the pixels on the top and bottom. (Or on the sides, for a tall rectangle.)
And as Boiler indicated, if I wanted this to be a rectangle, I'd keep the same aspect ratio (square) but just "erase" the pixels on the top and bottom. (Or on the sides, for a tall rectangle.)
ste(phen|ve) kunkel
-
- Posts: 140
- Joined: 28 Oct 2020, 02:58
Re: tray icons usage
yeah okay thank you. i'm currently working on making my own icons too but in svg then i can make them any size without losing quality and convert to .ico
Re: tray icons usage
Yeah, I always make mine as SVGs too. Converting them to ICO always "rasterizes" them though.marypoppins_1 wrote: ↑09 May 2024, 08:28yeah okay thank you. i'm currently working on making my own icons too but in svg then i can make them any size without losing quality and convert to .ico
ste(phen|ve) kunkel
-
- Posts: 140
- Joined: 28 Oct 2020, 02:58
Re: tray icons usage
what do you mean? after making them in svg, i scale them to let's say 256x256 png then convert png to ico. and pretty sure then windows downscales it to 16x16 or whatever scale it needs for the taskbar. works for me
Re: tray icons usage
Yep -- Again, same here. I think the downscaling that Windows does is probably the same procedure that most icon-conversion tools use. Personally, I find that the antialiasing makes most of my images blurry when they are reduced in size, especially if the larger image was very detailed. That's just my own experience though.marypoppins_1 wrote: ↑09 May 2024, 11:34what do you mean? after making them in svg, i scale them to let's say 256x256 png then convert png to ico. and pretty sure then windows downscales it to 16x16 or whatever scale it needs for the taskbar. works for me
ste(phen|ve) kunkel
Re: tray icons usage
I agree that a .ico file that contains various size images drawn specifically for that size looks much better than letting Windows scale up or down based on one size.