C
charlym
Hello newsgroup!
I am trying to reset a specific area in a BufferedImage that has been
set up using an Alpha chanel (TYPE_INT_ARGB). The idea is that I have
to refresh a certain area an therefore I want to clear it before I
redraw it. Currently I am using the following code:
In the constructor:
this.image = new BufferedImage(this.getWidth(),
this.getHeight(), BufferedImage.TYPE_INT_ARGB);
this.dirtyHack = new BufferedImage(this.getWidth(),
this.getHeight(), BufferedImage.TYPE_INT_ARGB);
In the paintComponent method:
image.setData(dirtyHack.getData(bounds));
This works, but it uses a lot of memory. Is there a cheaper way of
doing this?
Thanks for your help!
I am trying to reset a specific area in a BufferedImage that has been
set up using an Alpha chanel (TYPE_INT_ARGB). The idea is that I have
to refresh a certain area an therefore I want to clear it before I
redraw it. Currently I am using the following code:
In the constructor:
this.image = new BufferedImage(this.getWidth(),
this.getHeight(), BufferedImage.TYPE_INT_ARGB);
this.dirtyHack = new BufferedImage(this.getWidth(),
this.getHeight(), BufferedImage.TYPE_INT_ARGB);
In the paintComponent method:
image.setData(dirtyHack.getData(bounds));
This works, but it uses a lot of memory. Is there a cheaper way of
doing this?
Thanks for your help!