There are format specific functions and methods to retrieve the number of pages in an image file. For example: GetNumberOfImagesInTiffFile, GetNumberOfImagesInGifFile etc. There is a also a general function/method in BiDIB DLL/OCX, GetNumberOfImagesInFile.
[C++]
/* Retrieving the number of pages in an image file*/
#include “BiDIB.h”
int iPages = GetNumberOfImagesInFile(“C:\\Images\\Test.tif”);
[VB]
‘ Retrieving the number of pages in an image file
Dim iPages As Long
Dim BiDIBobj as Object
Set BiDIBobj = CreateObject("BIDIB.BIDIBCtrl.1")
iPages = BiDIBobj.GetNumberOfImagesInFile _ (“C:\Images\Test.tif”)
Set BiDIBobj = Nothing
[C#]
/* Retrieving the number of pages in an image file*/
int iPages;
iPages = BiDIB.GetNumberOfImagesInFile(“C:\\Images\\Test.tif”);