
Originally Posted by
benc_1
The device must therefore convert the RGB values when reading in a PNG into a screen friendly format but i've no idea how it does this. Can anybody shed some light on this for me?
Everytime you open a image with Image.createImage(..) The image is decoded and stored in a "screen friendly" format (as some kind of bitmap).

Originally Posted by
benc_1
And yes I know the device format is 5:6:5 RGB but looking at the values from getRGB it hasn't converted them into that.
The getRGB() method returns an integer array with one integer = one pixel, see javadoc of getRGB() for the next (and even more):
Obtains ARGB pixel data from the specified region of this image and stores it in the provided array of integers. Each pixel value is stored in 0xAARRGGBB format, where the high-order byte contains the alpha channel and the remaining bytes contain color components for red, green and blue, respectively.
The returned values are not guaranteed to be identical to values from the original source, such as from createRGBImage or from a PNG image. Color values may be resampled to reflect the display capabilities of the device...
I've written a method a while ago that creates an "gradient-array" You could try it...
It returns an array that starts with aStartColor and turns smoothly into aEndcolor. aLength determines the length of the array(gradient).
Code:
public int[] getGradient(int aStartColor, int aEndColor, int aLength){
int r1 = aStartColor>>16;
int g1 = aStartColor>>8;
g1 = g1 & 0x0000FF;
int b1 = aStartColor;
b1 = b1 & 0x0000FF;
int r2 = aEndColor>>16;
int g2 = aEndColor>>8;
g2 = g2 & 0x0000FF;
int b2 = aEndColor;
b2 = b2 & 0x0000FF;
int res_r = 0;
int res_g = 0;
int res_b = 0;
int gradient[] = new int[aLength];
int counter = 0;
int dif;
while(counter < aLength){
dif = (aLength-counter);
res_r = (r1 * dif + r2*counter)/aLength ;
res_g = (g1 * dif + g2*counter)/aLength ;
res_b = (b1 * dif + b2*counter)/aLength ;
res_r = res_r <<16;
res_g = res_g <<8;
gradient[counter] = (res_r | res_g | res_b);
counter++;
}
return gradient;
}