> I am trying to reset a specific area in a BufferedImage
[...]
> This works, but it uses a lot of memory. Is there a cheaper way of
> doing this?
image.getGraphics().clearRect(...);
Check the API doc for details.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
charlym - 29 May 2006 09:03 GMT
Thomas & the rest of the newsgroup,
I tried this but it does not do what I expected. I want the rectangle
to be totally transparent. clearRect fills the rectangle with the
backgroundcolor :-( I also tried to change the color using a
transparent color (new Color(0,0,0,0)) but it did not help either.
Any other ideas?
Oliver Wong - 29 May 2006 16:14 GMT
> Thomas & the rest of the newsgroup,
>
[quoted text clipped - 4 lines]
>
> Any other ideas?
From the javadocs:
<quote>
Beginning with Java 1.1, the background color of offscreen images may be
system dependent. Applications should use setColor followed by fillRect to
ensure that an offscreen image is cleared to a specific color.
</quote>
Did you try that?
- Oliver