Visual Basic (Declaration) | |
---|---|
Overloads Public Sub Save( _ ByVal fileName As String, _ ByVal format As RasterImageFormat, _ ByVal bitsPerPixel As Integer, _ ByVal qualityFactor As Integer _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void Save( string fileName, RasterImageFormat format, int bitsPerPixel, int qualityFactor ) |
Managed Extensions for C++ | |
---|---|
public: void Save( string* fileName, RasterImageFormat format, int bitsPerPixel, int qualityFactor ) |
C++/CLI | |
---|---|
public: void Save( String^ fileName, RasterImageFormat format, int bitsPerPixel, int qualityFactor ) |
Parameters
- fileName
- A String containing the output file name.
- format
- The output file format. For valid values, refer to Summary of All Supported Image File Formats.
- bitsPerPixel
- Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Summary of All Supported Image File Formats. If bitsPerPixel is 0, the image will be stored using the closest bits per pixel value supported by that format. For example, if a file format supports 1, 4, and 24 bits per pixel, and RasterImage.BitsPerPixel is 5, the file will be stored as a 24-bit image. Likewise, if RasterImage.BitsPerPixel is 2, the file will be stored as a 4-bit image.
- qualityFactor
- A quality factor to be used when saving the RasterImageViewer.Image to a file.
This example will load a 24 bits per pixel CMP image and save it as 1 bits per pixel TIF image.
Visual Basic | Copy Code |
---|---|
Public Sub RasterImageViewer_Save2(ByVal viewer As RasterImageViewer) |
C# | Copy Code |
---|---|
public void RasterImageViewer_Save2(RasterImageViewer viewer) |
You can set the qualityFactor parameter to a value from 2 to 255 when saving JPEG and LEAD CMP compressed images, where 2 represents the highest quality and 255 the most compression.
If the image is 8 bits per pixel or greater, use the LEAD CMP format or one of the JPEG (JTIF or JFIF) formats to save disk space.
If the image is 1-bit per pixel, use the LEAD 1-bit format or a CCITT Group 3 or 4 format to save disk space.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family