GetNumberOfImagesInFile

#include "BIDIB.H"

 

UINT CALLBACK GetNumberOfImagesInFile(LPTSTR szFileName, LPINT lpnErr)

Description

This function retrieves the number of pages in the specified file. This function is available for TIFF, PDF, MO:DCA, GIF, FAX and DCX file formats. The function can also be called for JPEG, PNG, BMP, IOCA, WMF, EMF, PCX, CLP, TGA or CALS files, but the return value will always be 1, because these file formats cannot contain more than one image.

Parameters

LPTSTR

SzFileName

Path and name of the image file.

LPINT

LpnErr

Error code.

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 the number of pages in the specified file, or 0 on error. The lpnErr parameter will contain the error code. Available error codes are listed in the LoadImageIntoDIB section.

Programming notes

The GetNumberOfImagesInFile function determines the file format based on the file content, not the extension, so any extension can be used for the files.

Requirements

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

Library :    Use BiDIB.lib.

DLLs :       BiDIB.dll.

Code example

None at present.