DefineTiffImageInfoBuffer

#include "BITIFF.H"

 

BOOL CALLBACK DefineTiffImageInfoBuffer( TIFFFILE hChain,
int              nImage,
UINT        wTagID,
LPVOID   lpData,
UINT        wType,
DWORD   dwCount)

Description

Generalized TIFF tag definition function. Refer to the desired information field by its tag identifier. If the referenced tag already exists, it will be overwritten by the new value. It is your responsibility to use the proper type for a predefined tag (see the list of tags in this document). See the "Programming notes" section for further information.

Parameters

TIFFFILE

hChain

Handle of a TIFF image chain.

int

nImage

Index of the image in the chain.

UINT

wTagID

Identifier of tag you want to define.

LPVOID

lpData

Pointer to data buffer.

UINT

wType

Type of data (see defines in BITIFF.H).

DWORD

dwCount

Number of data items (not bytes).

Return values

TRUE on success, otherwise FALSE.

Programming notes

There are tags, which are not allowed to be initialized by the user. The exact values of these tags are originated from the properties of the image you pass to the compression functions. See IsRequiredTag() for more information.

You can define your own tags with ID between 32768 and 65535 (except 33432, which stands for COPYRIGHT). Beware, these arbitrary (non-standard) tags will be useful only for your application. Other applications will simply ignore them. Serious problems may occur if the other application uses the same arbitrary tag as you use.

Requirements

Header :     Declared in BiTiff.h; include BiTiff.h.

Library :    Use BiTIFF.lib.

DLLs :       BiTiff.dll.

References to related functions

See IsRequiredTag(), DefineTiffImageInfo(), GetTiffImageInfo() and GetTiffImageInfoBuffer().

Code example

#include "BITIFF.H"

TIFFFILE hTiff;

int nImage;

BOOL bSuccess;

LPSTR lpszTitle = "My first TIFF image.";

.

.

.

// Creates a new TIFF file structure in memory.

hTiff = OpenTiffFile((LPSTR)"new.tif",T_CREATE);

if(hTiff != NULL)                                // Creating OK.

{

                // Defines an image in the TIFF structure.

                nImage = DefineTiffImage(hTiff);

                if(nImage >= 0)                    // Image definition OK.

                {

                                ...

                                // Defines the title of the image.

                                bSuccess = DefineTiffImageInfoBuffer(hTiff,nImage,

                                                                IMAGEDESCRIPTION,lpszTitle,

                                                                ASCIITYPE,_fstrlen(lpszTitle)+1);

                                ...

                                // Defines the compression method.

                                bSuccess = DefineTiffImageInfo(hTiff,nImage,

                                                                COMPRESSION,SHORTTYPE,CCITT_GROUP3);

                                ...

                }

}

...