ImageGear Professional v18.2 > API Reference Guide > Core Component API Reference > Core Component Functions Reference > General Image Functions > IG_image_is_gray |
This function is called to determine if an image is a grayscale image.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_image_is_gray( HIGEAR hIGear, LPAT_BOOL lpIsImageGray ); |
Name | Type | Description |
hIGear | HIGEAR | HIGEAR handle of image. |
lpIsImageGray | LPAT_BOOL | Pointer to a variable which will be overwritten with TRUE if the image is grayscale, and with FALSE if it is not grayscale. |
All pixel formats supported by ImageGear Professional.
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrcount; // Number of errors on stack HIGEAR hIGear; // Handle of image AT_BOOL bItsGray; // Will be set = TRUE if grayscale // Load image file "picture.bmp" from working directory nErrcount = IG_load_file("picture.bmp", &hIGear); if(nErrcount == 0) { nErrcount = IG_image_is_gray(hIGear, &bItsGray); // ... // Destroy the image IG_image_delete(hIGear); } |
The function considers the image to be grayscale, if either of the following is true:
FALSE is returned for all 1-bit indexed images, even if the palette contains two shades of gray. |