Example-VB | Example-VC++ |
Saves the displayed image document file or managed image document using the fully-qualified name specified.
Ö | Imaging for Windows Professional Edition V1.0, V1.1, and V2.0 |
Ö | Imaging for Windows 95 and 98 |
Ö | Imaging for Windows NT 4.0 |
Image Edit control
object.SaveAs Image[,FileType,PageType,CompressionType,CompressionInfo,SaveAtZoom]
Parameter | Data Type | Setting |
Image | String | The fully-qualified name of the image document being saved |
FileType | Integer (enumerated) |
The FileType the image is being saved as |
PageType | Integer (enumerated) |
The PageType the image is being saved as |
CompressionType | Integer (enumerated) |
The CompressionType at which the image is being saved |
CompressionInfo | Integer (enumerated) |
The CompressionInfo setting of the image being saved |
SaveAtZoom | Boolean | Whether the image is being saved using the current or original scale percentage value:
True The image is being saved using the current scale percentage value |
None
The Display method must be invoked prior to calling this method.
The SaveAs method saves the image using the name specified in the Image parameter. If the image document already exists, it is overwritten.
Upon successful completion of the SaveAs method, the image display window continues to display the original image; the Image property value remains unchanged. Continuing to display the original image ensures that the image on display is the same as the image specified in the Image property. For example, assume the currently displayed image is payroll.tif and the value of the Image property is also payroll.tif. When the SaveAs method is invoked with its Image parameter set to payroll98.tif, the image is saved as payroll98.tif. The image display window continues to display payroll.tif, and the Image property value remains unchanged at payroll.tif.
If a multipage image file (AWD, DCX, TIFF, WIFF, or XIF) is saved as a file type that does not support multipage image files (for example, BMP), only the page currently being displayed is saved to the new file. Note that this restriction does not apply to Imaging 1x documents. The entire document is saved in the original file type except for the displayed image, which is converted.
For the TIFF file type, annotations are saved as annotation data separate from the image data. For all other file types, annotations are lost unless the BurnInAnnotations method is invoked prior to calling the SaveAs method. The BurnInAnnotations method burns annotations onto an image, causing them to be permanently incorporated into the image.
In addition, document properties are saved within TIFF images only.
If the FileType parameter is not entered, the SaveAs method uses the original FileType setting of the image as a default. If the original FileType setting cannot be determined or is read-only, and the SaveAs method is saving to a local drive or file server, the method throws an Invalid File Format error. If the SaveAs method is saving to a document server, it saves the image as a TIFF file.
If the PageType and FileType parameters are not entered, the SaveAs method uses the original PageType setting of the image as a default. However, if a FileType is entered, the SaveAs method uses a PageType default setting that is associated with the FileType setting of the image. The following list describes the default PageType settings:
FileType Setting | Default PageType Setting |
1 TIFF | PageType setting of the displayed image |
2 AWD | 1 Black-and-white |
3 BMP | PageType setting of the displayed image |
If the CompressionType parameter is Group3(2D), the SaveAs method saves the image using the Group4(2D) compression type. If the CompressionType parameter is LZW, the SaveAs method saves the image using no compression.
If the CompressionType parameter is not entered, the SaveAs method uses a default CompressionType setting that is associated with the FileType and PageType settings of the image. The following list describes the default CompressionType settings:
FileType Setting | PageType Setting | Default CompressionType Setting |
2 AWD | 1 Black-and-white | 1 No compression |
3 BMP | 1,5,7 All supported PageTypes | 1 No compression |
1 TIFF | 1 Black-and-white | 2 Group3(1D) |
1 TIFF | 2 Gray4 | 1 No compression |
1 TIFF | 3 Gray8 | 1 No compression |
1 TIFF | 4 Palettized4 | 1 No compression |
1 TIFF | 5 Palettized8 | 1 No compression |
1 TIFF | 6 RGB24 | 1 No compression |
Note: AWD is not available with Imaging for Windows NT 4.0.
To use a PageType setting of 4 (Palettized4), the displayed image must already be a Palettized4 image.
If the CompressionInfo parameter is not entered, the SaveAs method uses a default CompressionInfo setting that is associated with the CompressionType setting of the image. The following list describes the default CompressionInfo settings:
CompressionType Setting | CompressionInfo Default Setting |
1 No compression | 0 No compression |
2 Group3(1D) | 8 Compressed LTR, 16 Expand LTR, 1 EOL, and 4 Prefixed EOL |
3 Group3(Modified Huffman) | 8 Compressed LTR and 16 Expand LTR |
4 PackBits | 16 Expand LTR |
5 Group4(2D) | 2 Packed Lines, 8 Compressed LTR, and 16 Expand LTR |
6 JPEG | 1024 Medium Compression/Medium Quality |
9 LZW | 0 No compression |
When a CompressionInfo value of 0 is entered with the CompressionType parameter set to 1 (no compression), the file is saved using no compression.
When a CompressionInfo value of 0 is entered with the CompressionType parameter set to a value other than 1, the file is saved using the default CompressionInfo parameter settings that correspond to the setting of the CompressionType parameter (as explained in the preceding list).
For example, if the end user specifies a CompressionType value of 1 (no compression) and then a CompressionInfo value of 0, the file is saved using no compression. If the end user specifies a CompressionType value of 2 (Group3[1D]) and then a CompressionInfo value of 0, the file is saved using the default CompressionInfo values for Group3(1D):
8 Compressed LTR,
16 Expand LTR,
1 EOL, and
4 Prefixed EOL
If the SaveAtZoom parameter is not specified, the image is saved using the original zoom scale percentage value.
Invoking the SaveAs method sets the ImageModified property to False.
If you want your program to process Imaging 1.x managed documents or files, you must include an Image Admin control in your project and set its FileStgLoc1x property to the appropriate value.
When saving existing Imaging 1.x managed documents as new Imaging 1.x managed documents, you can use the ForceFileLinking1x property of the Image Admin control to determine whether the SaveAs method creates copies of the individual image files in the file repository, or creates links to them. When creating copies of the individual image files, you can use the FileStgLoc1x property of the Image Admin control to determine the location of the file repository.
You cannot save image documents to Imaging 3.x Servers.
Imaging 1.x and 3.x Server access is available with Imaging for Windows Professional Edition V1.1 and V2.0 only.
The SaveAs method does not function when a URL has been entered into the Image property.