CImage:SaveTo


The SaveTo method saves the CImage to a file with a new file name. This method does not prompt for the new file name. To prompt, use SaveAs.

Syntax

bSuccess = CImage:SaveTo( sPath )

where

    sPath is a path name where the file is saved.

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

  

When using a loop to save multiple images, you may wish to prompt for the text fragment to be used for renaming the files. You can do that for the first image in the loop by using the SaveAs class method to select the path or get a template file name, or by calling the global GetString function. Afer the first image is saved, you can use SaveTo for the remaining images.

Example

Suppose a CImage object I contains an image to be saved with a new file name. The following script does this without prompting for the new filename:

I = CImage:new()

-- create a CImage object

sPath = C:\\NewName.fts"

-- the new file name

bOk = I:SaveTo( sPath )

-- Save the image to its new file name

  --

-- do something

Related Topics

SaveAs

Save

CImage class