LEADTOOLS Raster Imaging C DLL Help > Function References > L_LoadBitmapList |
#include "l_bitmap.h"
L_LTFIL_API L_INT L_LoadBitmapList(lpszFile, phList, nBitsTo, nColorOrder, pLoadOptions, pFileInfo)
L_TCHAR* lpszFile; |
/* name of the file to load */ |
pHBITMAPLIST phList; |
/* address of the variable to be updated */ |
L_INT nBitsTo; |
/* resulting bitmap pixel depth */ |
L_INT nColorOrder; |
/* color order for 16-, 24-, and 32-bit bitmaps */ |
pLOADFILEOPTION pLoadOptions; |
/* pointer to optional extended load options */ |
pFILEINFO pFileInfo; |
/* pointer to a structure */ |
Creates a bitmap list and loads bitmaps from a multi-page file into the list.
Parameter |
Description |
|
lpszFile |
Character string containing the name of the file to load. |
|
phList |
Address of the HBITMAPLIST variable for the new list. |
|
nBitsTo |
Resulting pixel depth of bitmaps in the list. The following are valid values: |
|
|
Value |
Meaning |
|
0 |
Keep the original file's pixel depth (Do not convert). A special note about loading 12 and 16-bit grayscale images. |
|
1 to 8 |
The specified bits per pixel in the resultant bitmaps |
|
12 |
12 bits per pixel in the resultant bitmap. |
|
16 |
16 bits per pixel in the resultant bitmaps |
|
24 |
24 bits per pixel in the resultant bitmaps |
|
32 |
32 bits per pixel in the resultant bitmaps |
|
48 |
48 bits per pixel in the resultant bitmap |
|
64 |
64 bits per pixel in the resultant bitmap |
nColorOrder |
Color order for 16-, 24-, 32-, 48- and 64-bit bitmaps. If the resultant bitmaps are less than 16 bits per pixel, this will have no effect since palletized images have no order. The following are valid values: |
|
|
Value |
Meaning |
|
ORDER_RGB |
[0] Red, green, and blue color order |
|
ORDER_BGR |
[1] Blue, green, and red color order |
|
ORDER_GRAY |
[2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in Document and Medical Imaging toolkits. |
|
ORDER_RGBORGRAY |
[3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document and Medical Imaging toolkits. |
|
ORDER_BGRORGRAY |
[4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in Document and Medical Imaging toolkits. |
|
ORDER_ROMM |
[5] ROMM order. ROMM only supports 24 and 48-bit images. |
|
ORDER_BGRORGRAYORROMM |
[6] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image OR as ROMM. 12 and 16-bit grayscale images are supported in Document and Medical Imaging toolkits. ROMM only supports 24 and 48-bit color images. |
pLoadOptions |
Pointer to optional extended load options. Pass NULL to use the default load options. |
|
pFileInfo |
Pointer to a FILEINFO structure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded. |
|
|
If nothing is known about the file, pass NULL for this parameter, or declare a variable of type FILEINFO and set the FILEINFO.Flags to 0, then pass the address of the FILEINFO structure in this parameter. In this case, if the address of a FILEINFO structure is passed, the FILEINFO structure will be updated with the results of L_FileInfo. |
|
|
If only the file type is known, set pFileInfo.Format to the file type and set pFileInfo.Flags to FILEINFO_FORMATVALID. This can also be done if L_FileInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling L_SetPCDResolution or L_SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of L_FileInfo. |
|
|
If L_FileInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by L_FileInfo, then the address of the filled FILEINFO structure can be passed for this parameter. In this case, the FILEINFO.Flags member should be set to FILEINFO_INFOVALID. The L_FileInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type. |
|
|
Note: Local variables are not initialized (since they are placed on the stack). So if you have a FILEINFO structure as a local variable, the value of its Flags parameter is undefined, possibly having FILEINFO_INFOVALID or FILEINFO_FORMATVALID set. That is why it is important to initialize FILEINFO.Flags before passing the address of the FILEINFO structure to the function. |
Returns
SUCCESS_ABORT |
The function was successful, but one or more pages could not be loaded. *phList contains the pages which were loaded properly. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
Support for 12 and 16-bit grayscale images is only available in the Medical Imaging toolkits.
Before calling this function, you must declare a variable of data type HBITMAPLIST. You can then pass the address of the variable in the phList parameter, which this function will update with the handle to the bitmap list.
Note: |
More options are available in the LOADFILEOPTION structure. |
Note: You should never pass an uninitialized FILEINFO structure to this function.
Required DLLs and Libraries
LTFIL For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Win32, x64, Linux.
See Also
For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.
Example
For a short example, refer to L_ProcessPlayback. For complete sample code, refer to the FRAME.C module of the DEMO example.