CImageView:new CImageView:SaveUndoAll

CImageView:SaveUndo


The SaveUndo method saves an "undo" copy of an CImage in its current state. The target image may be the current displayed image or the CImageSet member at a specific index.

Syntax

bResult = CImageView:SaveUndo()

bResult = CImageView:SaveUndo( nIndex )

bullet.gif    nIndex is the index of the target image in the CImageSet, in the range range 1 to Count. If not specified, then the current image is used.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

This method saves an undo copy of the target image. The image can later be restored using the Undo method.

Example

Assume that a CImageView exists and is assigned toV. The following script saves an undo copy, changes the image, then restores it:

V = new_imageview()

-- create a CImageView object

I = new_image()

-- create a CImage

local sPath, bOk = GetFileName()

-- use the Open dialog to get a filename

I:Open(sPath)

-- load the image

V:Display(I)

-- display the image in the CImageView

V:SaveUndo()

-- save an undo copy of the image

I:Add(30.5)

-- add 30.5 to all pixel values.

V:Undo()

-- restore the image to its state before adding 30.5.

Related Topics

CImageView, Undo, SaveUndoAll, UndoAll, Display, CImage class


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.