I'm using the getNativePixelFormat() to find the local pixel format of each phone.
Although the getNativePixelFormat() returns a value, when I place it in the follwoing code it throws the following error:
"java.lang.IllegalArgumentException: Display format not supported on device 4444".
private Image ImageSource(int array[], int width, int height) {
Image img = DirectUtils.createImage(width, height, 0xf0000000);
Graphics myG = img.getGraphics();
DirectGraphics dg = DirectUtils.getDirectGraphics(myG);
dg.drawPixels(array, true, 0, width, 0, 0, width, height, 0,
dg.getNativePixelFormat());
return img;
}
However if I place "8888" in the same code then it works. This is not logical as getNativePixelFormat() is returning 4444, not 8888.
Your help will be greatly apprecieted.

Reply With Quote

