Search code examples
javaswingbufferedimagegraphics2d

Deleting a BufferedImage drawn on another BufferedImage


I have a BufferedImage called originalImage that is drawn on a JPanel. I have an array of BufferedImage called layer and I draw all of those layer on the originalImage

So how can I delete (for example) layer[0] entirely from the originalImage ?


Solution

  • Simple answer: you can't! Just delete one layer entry and paint everything new. It's at low cost, so don't worry.