It might be too late to help your project since you sounded in a hurry, but 
here's a reply to the question anyway:

As of Java 1.5, I think ImageIO can read BMP's fine.

So you should be able to call:
BufferedImage image = ImageIO.read(bmpFile);

Then if you want to make sure that data is in, say, ARGB format, you can say:

int type = image.getType();
if(type!=BufferedImage.TYPE_INT_ARGB) {
    BufferedImage tempImage = new 
BuffereDImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB);
    Graphics g = tempImage.createGraphics();
    g.drawImage(image,0,0,null);
    g.dispose();
    image = tempImage;
}

Then you can get specific pixel data efficiently with calls like:

image.getRaster().getDataElements(0,0,width,height,myBigIntArray);

Each entry in myBigIntArray is an ARGB value, so you can say:
int alpha = (myBigIntArray[i] >> 24) & 0xff;
int red = (myBigIntArray[i] >> 16) & 0xff;
int green = (myBigIntArray[i] >> 8) & 0xff;
int blue = (myBigIntArray[i] >> 0) & 0xff;

Does this answer your question?

There are probably more efficient things you can do to get at the data you 
want, but without knowing more about your situation that's my first guess at 
how to approach it.
[Message sent by forum member 'mickleness' (mickleness)]

http://forums.java.net/jive/thread.jspa?messageID=252809

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to