ImageEn, unit imageenproc

TImageEnProc.UndoAt

TImageEnProc.UndoAt


Declaration

procedure UndoAt(Position: Integer; AutoUndoRedo: Boolean = False);


Description

Replaces the current image with the one at Position in the Undo stack.

Parameter Description
Position Undo index to restore: 0 = last saved undo, 1 = second to last saved undo, 2... up to UndoCount - 1
AutoUndoRedo Set to true for automatic redo support. Saves the current state (before undo) to the redo stack (i.e. calls SaveRedo) and removes this and prior entries from the Undo stack

Note: AutoUndoRedo should always be set to true if you support multiple undo (i.e. UndoLimit > 1 )


Demo

Demo  Demos\ImageEditing\UndoRedo\UndoRedo.dpr


Examples

// Undo the last item (same as calling ImageEnView1.Proc.Undo)
ImageEnView1.Proc.UndoAt( 0, True );

// Undo All
ImageEnView1.Proc.UndoAt( ImageEnView1.Proc.UndoCount, True );


Compatibility Information

In v6.2.1 and older versions, AutoUndoRedo would only assign the current state to the Redo List, and the undone item is not cleared. From v6.3.0, AutoUndoRedo clears all undone entries and assigns them to the redo list.


See Also

CanUndo
UndoRect
Undo


Loading contents...