LFile::EnumTags
#include "ltwrappr.h"
L_INT LFile::EnumTags(uFlags, pLoadOptions)
L_UINT uFlags; |
/* reserved for future use. Pass 0. */ |
pLOADFILEOPTION pLoadOptions; |
/* pointer to optional extended load options */ |
Enumerates all the tags in a file. Currently, only TIFF and Exif files contain tags.
Parameter |
Description |
uFlags |
Flags parameter. Reserved for future use. Pass 0. |
pLoadOptions |
Pointer to optional extended load options. Pass NULL to use the default load options. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
For multipage TIFF files, you can enumerate the tags from a particular page. Specify the page number on which to enumerate the tags using the pLoadOptions structure. For more information, refer to the LOADFILEOPTION structure.
This function enumerates the standard TIFF tags and the user tags. Standard TIFF tags are less than 32767. User TIFF tags are usually between 32768 and 65535.
To read a tag value, call LFile::ReadTag.
Note that if LFile::EnumTagsCallBack returns a value other than SUCCESS, LFile::EnumTags will stop enumerating the tags and return the value returned by LFile::EnumTagsCallBack as its return value.
Do not attempt to use the LFile::DeleteTag function to delete tags from inside an LFile::EnumTagsCallback callback function. If you want to delete tags that you enumerate, use LFile::EnumTagsCallback to add the tags to a list. Upon returning from LFile::EnumTags, you can delete all the tags from the list.
Required DLLs and Libraries
LTFIL LFCMP For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
L_INT LFileChild::EnumTagsCallBack(L_UINT16 uTag, L_UINT16
uType, L_UINT32 uCount)
{
L_TCHAR
s[100];
wsprintf(s,
TEXT("Tag = %d, Type = %d, Count = %d"), uTag, uType, uCount);
MessageBox(NULL,
s, TEXT("EnumFileTagCallback"), MB_OK);
return
SUCCESS;
}
void EnumfiletagsExample()
{
/*
This example will read all the user tags from page 1 of " C:\\file.tif".
*/
LFileChild
lfc ;
lfc.EnableCallBack(TRUE)
;
lfc.SetFileName(TEXT("C:\\file.tif"))
;
/*
Enumerate the tags */
L_INT
nRet = lfc.EnumTags(0, NULL);
}