I have created a simple icon in Gimp2 and converted it, so I can display it on a label.
The icon is this:
public static final byte[] RedButton16 =
{
71, 73, 70, 56, 57, 97, 16, 0,
16, 0, -95, 2, 0, 0, 0, 0,
-1, 0, 0, -1, -1, -1, -1, -1,
-1, 33, -7, 4, 1, 10, 0, 2,
0, 44, 0, 0, 0, 0, 16, 0,
16, 0, 0, 2, 37, -108, 29, -87,
113, -67, -97, 28, -124, 6, 76, 42,
-18, -76, -6, -15, -82, 124, 96, 32,
-126, 101, 119, 106, 64, -118, -79, 79,
-27, 70, -57, -102, 2, -51, 76, -45,
119, 1, 0, 59
};
To load the icon into the label I use this code:
private ImageIcon getRedIcon()
{
if(MainPanel.mRedIcon == null)
MainPanel.mRedIcon = new ImageIcon(GUIIcons.RedButton16);
return MainPanel.mRedIcon;
}
foo()
{
mStatusLabel.setIcon(getRedIcon());
}
I can see the icon on the screen, but the color is wrong. When I view it with an external viewer it looks as I created it. Either red or green (I have two versions, both are GIF files) and both have the same problem. I assume that there might be a problem with the alpha channel, but I have no idea whats wrong and how to fix it, or how Java inteprets the data. Do I have to fix the image, or do I have to set some options on the Imageloader?
update
I uploaded the images here. How I created them and how they look on screen in my Java application.