L_INT LImageListControl::ExportBitmapList(pExportList)
Exports a number of bitmaps from the ImageList Control to a Bitmap List.
Pointer to the LILEXPORTBITMAPLIST structure that contains the list of bitmaps to be exported.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 0 | An error occurred. Refer to Return Codes. |
You must set the uStructSize member of the LILEXPORTBITMAPLIST structure before using this function.
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 list hList, since it is going to have a reference to the original bitmaps--not a copy of them.
Win32, x64.
L_INT LImageListControl__ExportBitmapListExample(HWND hWnd, LBitmapList& BitmapList, LImageListControl& ImgList)
{
UNREFERENCED_PARAMETER(hWnd);
L_INT nRet ;
LILEXPORTBITMAPLIST ExportList;
// Check if the ImageList control has any images.
nRet = ImgList.GetItemCount() ;
if( nRet > 0)
{
ZeroMemory(&ExportList, sizeof(LILEXPORTBITMAPLIST));
ExportList.uStructSize = sizeof(LILEXPORTBITMAPLIST);
ExportList.nStartIndex = 0; // Start from index 1
ExportList.nItemsToExport = 1; // Export only 2 images.
// Export images
nRet = ImgList.ExportBitmapList(&ExportList) ;
if(nRet != SUCCESS)
return nRet;
// Check if the images exported successfully
if(ExportList.hList)
{
// Save the exported images to a disk-file
BitmapList.SetHandle(ExportList.hList);
nRet = BitmapList.Save(MAKE_IMAGE_PATH(TEXT("outputfile.gif")), FILE_GIF, 0, 2, NULL);
if(nRet != SUCCESS)
return nRet;
}
}
else
return nRet;
return SUCCESS;
}
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