GetTiffImagePalette

#include "BITIFF.H"

HPALETTE CALLBACK GetTiffImagePalette(LPTSTR lpszFileName, int nImage)

Description

Loads the palette of n-th image from the TIFF file into a HPALETTE Windows GDI object. Does all low-level calls internally in the DLL. Do not use this function for monochrome images. In this case the function simply returns NULL.

Parameters

LPTSTR

lpszFileName

Path to the TIFF file.

int

nImage

Index of the asked image.

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

Returns a handle to a HPALETTE or NULL in case of any error. It sets the error code to TTOOFEWINFO if indispensable tags are missing or TBADNUMBEROFCOLORS if incorrect bit depth or planar configuration is detected. To retrieve the last error, use the TiffError() function.

Programming notes

When you no longer need the palette, call the MS Windows SDK DeleteObject() function to delete it.

This function was designed to be used with high level application generators like Borland C++ Builder, Borland Delphi or MS Visual Basic.

Requirements

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

Library :    Use BiTIFF.lib.

DLLs :       BiTiff.dll.