CImage:Save CImage:SaveTo

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

bResult = CImage:SaveAs( sPath )

bResult = CImage:SaveAs()

Remarks

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 fragment 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

CImage, SaveTo, Save