ImageGear Professional v18.2 > API Reference Guide > Core Component API Reference > Core Component Functions Reference > Info Functions > IG_page_count_get_FD |
This function obtains the number of pages in the image file specified by its file handle.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_page_count_get_FD( AT_INT fd, LONG lOffset, LPUINT lpPageCount ); |
Name | Type | Description |
fd | AT_INT | Handle of the open file. This handle can be obtained from Microsoft Windows function such as CreateFile(), and cast to AT_INT for passing to the function parameter. FILE pointers returned by functions such as fopen(), and file handles returned by functions such as _sopen_s() are not supported. |
lOffset | LONG | Offset into the file, in bytes, to where the image begins. This is the offset to the beginning of the header, not to the beginning of the bitmap. lOffset is usually 0. |
lpPageCount | LPUINT | Pointer to a UINT variable to receive page count . |
All pixel formats supported by ImageGear Professional.
Copy Code
|
|
---|---|
HANDLE fd; // File Descriptor UINT nPages; // Will receive number of pages AT_ERRCOUNT nErrcount; // Count of returned errors fd = CreateFile(_T("picture.bmp"), GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if(fd != INVALID_HANDLE_VALUE) { nErrcount = IG_page_count_get_FD((AT_INT)fd, 0, &nPages); CloseHandle(fd); } |
Call this function when the file is already opened and you have its File Descriptor handle (fd).