CImage:SaveAs


The SaveAs method saves the CImage to a file with a new name as entered into a Windows Save As dialog. Also see the SaveTo method.

Syntax

bSuccess = CImage:SaveAs( sPath )

bSuccess = CImage:SaveAs()

where

    sPath is the full file path name. If not specified, Mira opens a Save As dialog. If you click [OK] and the save is successful, the method returns true. If the save is unsuccessful or you click [Cancel], the method returns false.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

If you do not specify the new name sPath, Mira prompts for it with by opening a Windows Save As dialog. If you click Cancel on the Save As dialog, Mira returns false. Testing for false is a handy way to exit a loop that saves multiple images.

This method opens a Save As dialog every time. Therefore, when using a loop to save multiple images to a new file name, you may wish to use the SaveTo method. Alternatively, you can call SaveAs for the first file name, extract what you need from the entered text, then switch to SaveTo for the remaining images.

Example

Suppose a CImage named I contains an image to be saved. The following script saves it to a new file after prompting for the new filename:

I = CImage:new()

-- create a CImage object

bOk = I:SaveAs()

-- Note: No path name specified

  --

-- do something

Related Topics

SaveTo

Save

CImage class