Clearing BufferedImage?

Hi, I have a 3D app that displays a buffered image regularly. At first I wrote to the same bufferedimage every display time, which resulted in the previous image not being cleared. My solution was to create a new buffered image every time the display function is called like so:

zCol =new BufferedImage(screenX, screenY,BufferedImage.TYPE_INT_ARGB);

Now this works, but hogs roughly 70% of system resources, compared to 25% odd whenusing the previous example. My question is can a buffered image be cleared without re creating it? I have looked at BufferedImage's methods and found flush(), but this does not clear the image as I thought it might.

Thanks in advance :)

[728 byte] By [eddy86a] at [2007-11-26 13:10:02]
# 1
Just draw a background-coloured rectangle.
mlka at 2007-7-7 17:23:39 > top of Java-index,Java Essentials,Java Programming...
# 2
That doesn't work, I assume because the BufferedImage still contains all the old images that have been displayed using it, so it just paints that.
eddy86a at 2007-7-7 17:23:39 > top of Java-index,Java Essentials,Java Programming...
# 3
> That doesn't work, I assume because the BufferedImage> still contains all the old images that have been> displayed using it, so it just paints that.Are you redrawing the buffered image?Does the 3D API buffer the image?
mlka at 2007-7-7 17:23:39 > top of Java-index,Java Essentials,Java Programming...
# 4

It's not a 3D API unfortunately, I have to write everything myself (to gain a 'better understanding' of 3D)

I am using a buffered image for zBuffering which is performed every time the object is rotated (about 20 times a second) with the zBuffer results being written to this buffered image. I then display the buffered image like so:

graphicsContext.drawImage(image, 0, 0, this);

I would have thought there would be a simple clear function for buffered image that I could call before each zBuffering is done.

eddy86a at 2007-7-7 17:23:39 > top of Java-index,Java Essentials,Java Programming...
# 5
> I would have thought there would be a simple clear> function for buffered image that I could call before> each zBuffering is done.There is bufferedImage.getGraphics().fillRect( 0, 0, w, h );
mlka at 2007-7-7 17:23:39 > top of Java-index,Java Essentials,Java Programming...
# 6
Ah I see, I misunderstood you first time around.Thanks for the help :)
eddy86a at 2007-7-7 17:23:39 > top of Java-index,Java Essentials,Java Programming...