Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

image editing with undo capability

  Asked By: Jeff    Date: Jan 17    Category: Java    Views: 1232

I need some help about an image editor program or something like
that, which has undo/redo capability. I just need some code as
example, which can undo/redo images.



1 Answer Found

Answer #1    Answered By: Liam Bouchard     Answered On: Jan 17

If you're just talking about one level of undo  - you could do that with
an offscreen bitmap.
I have used BufferedImage with much success.

BufferedImage image  = new BufferedImage(xm, ym,
DataBuffer imageBuf = ((BufferedImage)image).getRaster().getDataBuffer();
etc etc
save screen to buffer on commit, blit buffer to screen to undo......

If you want to have multiple levels of undo, you could use mulitple
buffers .....

Didn't find what you were looking for? Find more on image editing with undo capability Or get search suggestion and latest updates.