-1

I have a program that load images and let user edit images with options that I provided.

I'm working on the Undo/Redo button. So when I click on the Undo button, it should bring my image back to the last time before editing. I have ideas about UndoManager but I'm really don't know how to create a function for that.

Should I cast my image to BufferedImage?

dario
  • 5,149
  • 12
  • 28
  • 32
Joe
  • 11
  • 4
  • 2
    Can you be more specific about what your issue is? Can you put some of the relevant code? Can you tell us what have you tried and how is it not working? – Tavo May 01 '15 at 09:16
  • u can do temp files of the image . many ways ... simple is whole image (but huge size and many files) or log all changes and revert it back – Srinath Ganesh May 01 '15 at 09:32

1 Answers1

1

I recommend looking into Command pattern. If you are using Swing, that means Actions.

If you do it right, you can have "unlimited" undo/redo easily. You might need to serialize your edits after some time, to avoid running out of memory.

Harald K
  • 26,314
  • 7
  • 65
  • 111