filling an empty image

Hi, i’m using an BufferedImage to paint graphes of an functionplotter.
The background should be white, but it’s black from the beginnung.
So I’m coloring them all white in a for-loop. That takes too long (4 me :wink: ).
How can I get an White BufferedImage ??

eth

Draw a white rectangle.

http://java.sun.com/j2se/1.4.1/docs/api/java/awt/image/BufferedImage.html
^^ :confused:
I dont see a possibility to do that, without going the long way over a Graphics…

what is wrong with :-


Graphics g = bufferedImage.getGraphics()
g.setColor(Color.white);
g.fillRect(0,0,bufferedImage.getWidth(),bufferedImage.getHeight());
g.dispose();