#include "BITIFF.H"
BOOL CALLBACK GetTiffImageInfo( TIFFFILE hChain,
int iImage,
UINT wTagID,
LPVOID lpData)
Description
Retrieves the value of a single-data tag or the first value of a multiple-data tag reffered by wTagID. If lpData is NULL, the function only checks whether the tag exists or not. If tag data is type of SHORTTYPE, lpData is interpreted as pointer to a LONGTYPE (DWORD) !!! This solution is especially useful in case of tags where more than one valid types (SHORTTYPE and LONGTYPE) are allowed. If tag data is type of RATIONALTYPE, lpData must point to an array containing at least two LONG values to retrieve the data in. If tag data is type of ASCIITYPE, the function only checks whether the tag exist or not, and does not fill lpData, regardless the number of ASCII characters in the tag.
Parameters
|
TIFFFILE |
hChain |
Handle of a TIFF image chain. |
|
int |
iImage |
Index of the image in the chain. |
|
UINT |
wTagID |
Identifier of tag you want information about. |
|
LPVOID |
lpData |
Pointer to data item asked for. |
Return values
TRUE on success, otherwise FALSE. If the specified tag ID does not exist, the function returns FALSE, and set the error code to TNOSUCHTAG. Call TiffError() to retrieve the error code.
Programming notes
Both SHORTTYPE and LONGTYPE tags require pointer to DWORD in lpData parameter as described in section "Description" !
Requirements
Header : Declared in BiTiff.h; include BiTiff.h.
Library : Use BiTIFF.lib.
DLLs : BiTiff.dll.
Code example
#include "BITIFF.H"
TIFFFILE hTiff;
int nImage;
DWORD dwImageWidth; // Width of image in pixels.
...
// Registers the processed image first
GetTiffImage(hTiff,nImage);
// Default value.
dwImageWidth = 0; // Nonsense value.
// Retrieves value if tag exists.
GetTiffImageInfo(hTiff,nImage,IMAGEWIDTH,&dwImageWidth);
// Unregisters image
DropTiffImage(hTiff,nImage);
...