LImageListControl::ExportBitmapList

Summary

Exports a number of bitmaps from the ImageList Control to a Bitmap List.

Syntax

#include "ltwrappr.h"

L_INT LImageListControl::ExportBitmapList(pExportList)

Parameters

pLILEXPORTBITMAPLIST pExportList

Pointer to the LILEXPORTBITMAPLIST structure that contains the list of bitmaps to be exported.

Returns

Value Meaning
SUCCESS The function was successful.
< 0 An error occurred. Refer to Return Codes.

Comments

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.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

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 Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.