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”);
[C#]
/* Retrieving the number of pages in an image file*/
int iPages;
iPages = BiDIB.GetNumberOfImagesInFile(“C:\\Images\\Test.tif”);