Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Drawing images - Background and foreground color?

843807Dec 27 2008 — edited Dec 28 2008
At the moment I'm using an image with only two colors in it, and taking parts of it to render to a BufferedImage (a buffer) and finally to thescreen. The background part is easy -- it's a part of the function itself. But I want to be able to change the other color. This image I'm drawing from is just a way to get where to put foreground and background color.

A couple of questions come from this:
1. Is drawing from this image a good idea, or would it be faster just to draw individual rectangles from an array?
2. Is there a "color transform" class I could use to change the image's color before I copy from it? Or some other way to say white=(whatever color) and black=(other color)

And one that is not entirely related, but would increase my program's efficiency a lot:
3. Can I put one pixel into a BufferedImage, instead of a 1x1 rectangle?

Thanks for any help you can provide. :D (Many stars will be given for answers....)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 25 2009
Added on Dec 27 2008
4 comments
270 views