Search code examples
androidmemorybitmapvirtual-machineundo-redo

is it good idea to store bitmaps as temp files to implement undo and redo feature?


In my project i am making big changes on pixels of a bitmap and i want to add undo redo feature to this project.Sincesaving several bitmaps on VM's memory is not a good idea i thought my only choice is storing history(bitmaps) as temp files.Before starting to implement i want to be sure i am doing something not stupid here.


Solution

  • Depends on the processing power and the length of undo history you want to maintain. If you can apply the transformations with reasonable speed then you can just keep a copy of a bitmap x operations back and in case of an undo just apply the last x-1 transformations to it.