how to get alpha,red,green,blue values from getRGB() in j2me in respective arrays.
how to get alpha,red,green,blue values from getRGB() in j2me in respective arrays.
Vineet Billorey "The Great"
PHP Code:int width = img.getWidth();
int height = img.getHeight();
int[] pixels = new int[width * height];
img.getRGB(pixels, 0, width, 0, 0, width, height);
byte[] alpha = new byte[pixels.length];
byte[] red = new byte[pixels.length];
byte[] green = new byte[pixels.length];
byte[] blue = new byte[pixels.length];
for (int i = 0; i < pixels.length; i++) {
int pixel = pixels[i];
alpha[i] = (byte)(pixel >> 24);
red[i] = (byte)(pixel >> 16);
green[i] = (byte)(pixel >> 8);
blue[i] = (byte) pixel;
}
thanx for ur code.
Vineet Billorey "The Great"