I won't reiterate a previous issue for more getter methods, but add to them
instead. I noticed that when running under Windows (XP), the default icon size
is 16x16. Upon inspecting the WinTrayIconService.java code, I see that these are
constants. This is not the true case in windows. You can actually have larger or
smaller icon sizes under windows, due to change in DPI settings etc.... For some
random reason, my current system setting has them set to 17x17. Under my
KDE-linux setup, my icon size is 32x32.
What would be good to see, is under SystemTray, there is a java.awt.Dimension
getCurrentIconSize() method which would inspect the current tray settings on the
OS, to determine the size of the icon you need to generate. Furthermore, under
TrayIcon, a similar java.awt.Dimension getCurrentIconSize(). This may be
difficult to achieve though under Windows, as I have not been able to find
suitable methods of detecting this.
Why would this be useful? If you were able to get the size of the icon first,
you would be able to select suitable pre-drawn icons for the size, rather than
resize a large graphic down. The duke.gif animated gif in the TrayDemo looks a
little awful under Windows, because it is being squashed out of it's aspect
ratio, and there is no kind of sub-pixel rendering to improve the graphic. If
this was left up to the graphic designer or the java implementor at the time, to
know what size icon they need to draw, it would look a lot better.
Davy Boy Out...