Hi,
the new java version 1.6.0_20 is coursing some troubles with my transparent images. The transparency is swapped and the pixels of a buffered image are in the order ABGR.
Before it was RGBA.
How can I determine the order?
Since I want to have the correct colors in all of the versions (at least the newer java versions)
I tried this:
public void findPixelChannelOrder(){
BufferedImage image = FileController.getInstance().getImage("rsc/red.gif");
int firstpixel = image.getRGB(0,0);
int r = (firstpixel & 0xff000000) >> 16;
int g = (firstpixel & 0x00ff0000) >> 16;
int b = (firstpixel & 0x0000ff00) >> 16;
int a = (firstpixel & 0x000000ff) >> 16;
GUIController.getInstance().getConsole().print("r: "+r+" g: "+g+" b: "+b+" a: "+a);
if (r == 255){
EnvironmentController.getInstance().setRGBA(true);
}else{
if (a == 255){
EnvironmentController.getInstance().setRGBA(false);
}
}
}
but it is useless, had also some other configurations shifting in different direction etc but its not working.
I am stucked here.