Icon looks distorted
Closed this issue · 5 comments
@hrzafer If you're using a mac, then use an icon that is at least 24 x 24 pixels and define it as such in FXTrayIcon. I'v discovered that with the Mac, is doesn't really matter what dimensions you give FXTI above something like 22 x22 or somewhere around there if I remember correctly, and it ends up looking very nice... This key, for example, is being presented by FXTrayIcon and as you can see ... there are even noticeable details in the cut portion of the key...
.@hrzafer - I was just looking at the Oracle sample project for the AWT TrayIcon and they posted a gif file that they used for their icon. I copied that file and put a star in it. Here is how they create the image for the TrayIcon object:
final TrayIcon trayIcon = new TrayIcon(createImage("images/bulb.gif", "tray icon"));
USing this method to actually create the image:
protected static Image createImage(String path, String description) {
URL imageURL = TrayIconDemo.class.getResource(path);
if (imageURL == null) {
System.err.println("Resource not found: " + path);
return null;
} else {
return (new ImageIcon(imageURL, description)).getImage();
}
}
And here is the gif that I made from theirs:
Not sure it will be of any use to you, but it might be worth trying it their way to see if you get any different results.
I actually found it curious that they assigned a description to the image ... not sure what that's about...
I converted my logo.png
to logo.gif
via an online converter and it looks fine. Interesting. Thanks for the tip.
Closing as this issue is caused by underlying AWT code and not by FXTrayIcon specific code.