Getting Information about a HIGEAR Image
This section provides instructions on getting information for a HIGEAR.
- To find out if a HIGEAR variable currently holds a valid handle, call IG_image_is_valid:
|
Copy Code
|
if ( IG_image_is_valid(hIGear) ) { ... }
|
- Similarly, to find out if it is a grayscale image, call IG_image_is_gray:
|
Copy Code
|
if ( IG_image_is_gray(hIGear, &bItsGray) ) { ... }
|
- To obtain the width, height, and bits per pixel of an image, or the DIB compression type, use IG_image_dimensions_get or IG_image_compression_type_get (respectively):
|
Copy Code
|
AT_DIMENSION nWidth, nHeight;
UINT nBpp;IG_image_dimensions_get(hIGear, &nWidth, &nHeight, &nBpp);
DWORD nCompression;IG_image_compression_type_get(hIGear, &nCompression);
|
Be careful to declare the types as AT_DIMENSION and DWORD where shown above (rather than INT or UINT). On some development platforms, AT_DIMENSION and DWORD are not the same size as INT.
- To get the position and size of an image's image rectangle, use IG_dspl_layout_get() API.
Here also be careful to use the correct type: AT_RECT, not Windows structure type RECT, whose fields may be a different length.
- To set the image rectangle, use the function IG_dspl_layout_set(). Examples are provided in the sections Displaying Images and Saving Images.
- To obtain the resolution, use IG_image_resolution_get().
C and C++ |
Copy Code
|
AT_RESOLUTION resolution;
IG_image_resolution_get(image, &resolution.xResNumerator, &resolution.xResDenominator,
&resolution.yResNumerator, &resolution.yResDenominator, &resolution.nUnits);
|
If you need to access a DIB directly, refer to IG_image_DIB_palette_pntr_get().