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()

bullet.gif    If sPath is not specified, Mira opens a Windows 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.

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 saves it to a new file after prompting for the new filename:

I = new_image()

-- create a CImage object

bOk = I:SaveAs()

-- Note: No path name specified

  ...

-- do something

Related Topics

CImage class, SaveTo, Save


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