Sends this message to export a number of bitmaps from the ImageList Control to a Bitmap List.
Ignored, use 0.
Pointer to the LILEXPORTBITMAPLIST structure that contains the list of bitmaps to be exported.
Value | Meaning |
---|---|
SUCCESS | Function was successful. |
<0 | An error occurred. Refer to Error Codes. |
You must set the uStructSize member of the LILEXPORTBITMAPLIST structure before using this message.
The list of bitmaps will be exported from the ImageList control into the passed hList starting from nStartIndex to (nStartIndex + nItemsToExport 1).
If you passed NULL into the hList member of the passed LILEXPORTBITMAPLIST structure, this parameter hList will be created internally and is going to contain all the exported bitmaps.
After exporting the list of bitmaps successfully from the ImageList control, do not try to free the bitmaps of the exported hList list; since it is going to have a reference to the original bitmaps, not a copy of them.
The associated macro is:
For a complete list of available macros, refer to the Ltlst.h file.
L_INT ILM_EXPORTBITMAPLISTExample(HWND hCtrl, L_TCHAR * lpOutputFileName)
{
if(IsWindow(hCtrl))
{
L_INT nRet = SUCCESS;
// Check if the ImageList control has more than 4 images.
if(SendMessage(hCtrl, L_ILM_GETITEMCOUNT, 0, 0L) > 4)
{
LILEXPORTBITMAPLIST ExportList;
ZeroMemory(&ExportList, sizeof(LILEXPORTBITMAPLIST));
ExportList.uStructSize = sizeof(LILEXPORTBITMAPLIST);
ExportList.nStartIndex = 1; // Start from index 1
ExportList.nItemsToExport = 2; // Export only 2 images.
// Export images
nRet = (L_INT)SendMessage(hCtrl, L_ILM_EXPORTBITMAPLIST, (WPARAM)0, (LPARAM)(&ExportList));
// Check if the images exported successfully
if(ExportList.hList)
{
// Save the exported images to a disk-file
nRet = L_SaveBitmapList(lpOutputFileName,
ExportList.hList,
FILE_GIF,
0,
2,
NULL);
// Remove all of the BITMAPHANDLEs from the HBITMAPLIST because the ImageList owns them.
L_UINT uCount = 0;
L_GetBitmapListCount(ExportList.hList, &uCount);
for(L_INT x = uCount-1; x >= 0; x--)
{
BITMAPHANDLE Bitmap;
L_RemoveBitmapListItem(ExportList.hList, x, &Bitmap);
}
// Free the HBITMAPLIST
L_DestroyBitmapList(ExportList.hList);
}
}
return nRet;
}
else
return ERROR_INVALID_PARAMETER;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document