Sign in to follow this  
Cakey

[java] Question about Bitmap API[Solved]

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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, ...))

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this