GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / SaveAsTIFF Method / SaveAsTIFF(Int32,String,Boolean,TiffCompression,Int32) Method
A unique image identifier of the GdPicture image representing the image to be saved.
The file path where the specified image will be saved. Use the empty string to allow the control to prompt users to select a file. If the specified file already exists, it will be overwritten.

You can subsequently use the GdPictureImaging.GetLastPath method to retrieve the path of the selected file.

Set this parameter to true, if you want to save the required image as TIFF file in CMYK color space, otherwise set it to false.
A member of the TiffCompression enumeration. The resulting TIFF compression scheme to be used.
The compression quality level from 0 to 100. 0 means the worst quality and the best compression, 100 means the best quality and the worst compression. This parameter is ignored when the required compression scheme is different than JPEG.
Example





In This Topic
SaveAsTIFF(Int32,String,Boolean,TiffCompression,Int32) Method
In This Topic
Saves a required GdPicture image to a given file path as Tagged Image File Format (tif) acording to what you have specified. You can also define a JPEG quality parameter when the JPEG compression is required as well as you can utilize the CMYK color space when saving an image using this method.

This method only saves the currently selected page of the specified image if it is an editable multipage TIFF image.

Syntax
'Declaration
 
Public Overloads Function SaveAsTIFF( _
   ByVal ImageID As Integer, _
   ByVal FilePath As String, _
   ByVal CMYKMode As Boolean, _
   ByVal Compression As TiffCompression, _
   ByVal JpegQuality As Integer _
) As GdPictureStatus
public GdPictureStatus SaveAsTIFF( 
   int ImageID,
   string FilePath,
   bool CMYKMode,
   TiffCompression Compression,
   int JpegQuality
)
public function SaveAsTIFF( 
    ImageID: Integer;
    FilePath: String;
    CMYKMode: Boolean;
    Compression: TiffCompression;
    JpegQuality: Integer
): GdPictureStatus; 
public function SaveAsTIFF( 
   ImageID : int,
   FilePath : String,
   CMYKMode : boolean,
   Compression : TiffCompression,
   JpegQuality : int
) : GdPictureStatus;
public: GdPictureStatus SaveAsTIFF( 
   int ImageID,
   string* FilePath,
   bool CMYKMode,
   TiffCompression Compression,
   int JpegQuality
) 
public:
GdPictureStatus SaveAsTIFF( 
   int ImageID,
   String^ FilePath,
   bool CMYKMode,
   TiffCompression Compression,
   int JpegQuality
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the image to be saved.
FilePath
The file path where the specified image will be saved. Use the empty string to allow the control to prompt users to select a file. If the specified file already exists, it will be overwritten.

You can subsequently use the GdPictureImaging.GetLastPath method to retrieve the path of the selected file.

CMYKMode
Set this parameter to true, if you want to save the required image as TIFF file in CMYK color space, otherwise set it to false.
Compression
A member of the TiffCompression enumeration. The resulting TIFF compression scheme to be used.
JpegQuality
The compression quality level from 0 to 100. 0 means the worst quality and the best compression, 100 means the best quality and the worst compression. This parameter is ignored when the required compression scheme is different than JPEG.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Be aware that if the specified GdPicture image represents an editable multipage TIFF image, this method only saves the currently selected page. You should use the GdPictureImaging.TiffSaveMultiPageToFile method to save an editable multipage TIFF image instead.
Example
Applying ICM correction when saving CMYK based image as a tiff image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    string filePath = "image.jpg";
    if (gdpictureImaging.IsCMYKFile(filePath))
    {
        // Enable color correction.
        gdpictureImaging.EnableICM(true);
        int imageID = gdpictureImaging.CreateGdPictureImageFromFile(filePath);
 
        gdpictureImaging.SaveAsTIFF(imageID, "output.tiff", true, TiffCompression.TiffCompressionJPEG, 90);
 
        // Release used resources.
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
}
See Also