GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / IsCMYKFile Method
The file path of the image file to be checked.
Example





In This Topic
IsCMYKFile Method (GdPictureImaging)
In This Topic
Checks whether the specified image file is CMYK color space based.
Syntax
'Declaration
 
Public Function IsCMYKFile( _
   ByVal FilePath As String _
) As Boolean
public bool IsCMYKFile( 
   string FilePath
)
public function IsCMYKFile( 
    FilePath: String
): Boolean; 
public function IsCMYKFile( 
   FilePath : String
) : boolean;
public: bool IsCMYKFile( 
   string* FilePath
) 
public:
bool IsCMYKFile( 
   String^ FilePath
) 

Parameters

FilePath
The file path of the image file to be checked.

Return Value

true if the specified image file is using CMYK color space, otherwise false. The GetStat method can be subsequently used to determine if this method has been successful.
Remarks
It is recommend to use the GetStat method to identify the specific reason for the method's failure, if any.

Be aware that this method does not change the last file path used with this GdPictureImaging object.

This method requires the Image Documents component to run.

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