Creating Undo button for image processing

9 Ansichten (letzte 30 Tage)
Ahmed El sherif
Ahmed El sherif am 8 Apr. 2015
Beantwortet: David Ortegon am 21 Mai 2016
Hi, i have created a simple image processing project, i have about 12 buttons that perform different effects to an image, i wanna do something like "undo" button, for example, if i choose the Negative effect, then the Blue effect, and then the Green effect, i want to make the undo button so that when i press it i can go back to the Blue effect. How can i make that happen ?
PS: i have a global variable named "LL", each button saves its effect in LL,each effect replaces the previous one and will be saved in LL.

Akzeptierte Antwort

Adam
Adam am 9 Apr. 2015
Bearbeitet: Adam am 9 Apr. 2015
Firstly I really wouldn't recommend using global variables.
But in the interests of a short answer to the point of the question and using your chosen method for sharing data (this same idea would work equally using a better method of data sharing between buttons):
Just create a second (global) variable called lastLL (or preferably choose a more meaningful variable name than 'LL', but again, that is a side-issue!) and before each of your buttons applies their technique to overwrite LL just set
lastLL = LL;
Then in your undo button just set
LL = lastLL;

Weitere Antworten (1)

David Ortegon
David Ortegon am 21 Mai 2016
Ahmed, could you please send me your code for the bottomof undo. I have a project for a course and i dont know how to apply the global variable and the explanation. thanks.

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by