#include "BITIFF.H"
BOOL CALLBACK AddTiffTagToImage( LPTSTR lpsFileName,
int nImage,
UINT wTagID,
UINT wType,
LPSTR lpData,
DWORD dwCount)
Description
Adds a new tag and its data to an image and saves it in the TIFF file without displaying or decoding any of the images. If the specified tag already exists, the function will overwrite it.
Following data types are defined in the "BITIFF.H" file:
BYTETYPE (1 byte)
ASCIITYPE (1 byte)
SHORTTYPE (2 bytes)
LONGTYPE (4 bytes)
RATIONALTYPE (2 * 4 bytes)
Parameters
|
LPTSTR |
lpsFileName |
The TIFF file name. |
|
int |
nImage |
The n'th image in the TIFF file. |
|
UINT |
wTagID |
The tag ID to be added or updated. |
|
UINT |
wType |
Data type of tag. |
|
LPSTR |
lpData |
Far pointer to the tag data. |
|
DWORD |
dwCount |
Number of data items (not bytes). |
Additional Information
This example shows how to use the dll when loading statically including the header file. Otherwise if the dll is loaded dynamically, for further information read the “About the difference of static and dynamic library loading” section of the manual.
Return values
TRUE on success, FALSE if not a valid file name or parameter is used.
Programming notes
The first image in the TIFF file is 0. The AddTiffTagToImage() function will create a temporary file in the process of adding or updating a tag. It would require disk space of twice the size of the image file. Since this function does not use the image chain, so it must open and close the TIFF file for every added or updated tag. This is time sensitive operation, so it is not recommended to use this function to add or modify a large number of tags at once.
Requirements
Header : Declared in BiTiff.h; include BiTiff.h.
Library : Use BiTIFF.lib.
DLLs : BiTiff.dll.
References to related functions
See DeleteTiffTagOfImage(), IsRequiredTag().