[java] Question about Bitmap API[Solved]

Started by
3 comments, last by leif_dragon 15 years, 2 months ago
I want to read BASIC(Black or White) color information from a fairly large(800x800 pixels) saved bitmap, in the background of my application. So I was wondering, what API's/Methods I should be using to do this... Is this a slow process? Could this be done with JOGL? If so would the BufferedImage class be sufficient? Any idea's would be appreciated, the java API index honestly is giving me a headache. [Edited by - Cakey on January 20, 2009 12:02:27 PM]
Advertisement
Try taking a look at Java 2D.
Thanks. I'll be reading :).

Will Java2D allow me to access information about an image without having it being displayed?
Quote:Will Java2D allow me to access information about an image without having it being displayed?


Sure. Load your images into a BufferedImage object and you'll have access to them without having to render the image to the screen (which would require a call to Graphics2D.drawImage(myBufferedImage, ...))
You should look into the BufferedImage api for sure. In particular check out the BufferedImage.getRaster() method, it returns the image's pixel data in a modifiable array, which is probably the most efficient way of doing pixel operations on an image, besides using openGL/directX of course.

This topic is closed to new replies.

Advertisement