I am developing an application that must have a custom icon. The provided icon is the same in all sizes (256x256, 48x48, 32x32) except in 16x16 where the icon is simplified.
I thought about the .ico format (where I can store all the differents icons and let the OS showing the best) but it doesn't seem to be supported by the javafx.scene.image (I haven't found any confirmation about that).
Here is how I set up my icon
stage.getIcons().add(new Image(getClass().getResourceAsStream("/path/to/icon.ico")));
In this case the icon is never displayed. If I convert this icon into a .png image, this works but enforces to always display the same icon (even in 16x16).
Is there a way in JavaFX 2.2 to display a .ico (even in an hacky way) or do I have to use other image formats ?
Update
I separated my .ico into multiple png (one for each size) and then loading them one by one.
stage.getIcons().add(new Image(getClass().getResourceAsStream("/path/to/icon_16x16.png")));
stage.getIcons().add(new Image(getClass().getResourceAsStream("/path/to/icon_256x256.png")));
The 256x256 and the 16x16 are two different images but the 16x16 is never showed in the top left of the application (despite this is the nearest size).