LImageListControl::ImportBitmapList

#include "ltwrappr.h"

L_INT LImageListControl::ImportBitmapList(pImportList)

pLILIMPORTBITMAPLIST pImportList;

pointer to structure

Inserts a list of bitmaps into the ImageList Control.

Parameter

Description

pImportList

Pointer to the LILIMPORTBITMAPLIST structure that contains the list of bitmaps to be inserted.

Returns

SUCCESS

The function was successful.

< 0

An error occurred. Refer to Return Codes.

Comments

You must set the uStructSize member of the LILIMPORTBITMAPLIST structure before using this function.

The list of bitmaps found in the passed LILIMPORTBITMAPLIST structure will be inserted into the Image List control starting from nStartIndex to (nStartIndex + nItemsToInsert 1).

After inserting the list of bitmaps successfully into the ImageList control, do not try to free the bitmaps of the passed list (hLists bitmaps). The ImageList control will have a reference to hList bitmaps-- not a copy of them.

Required DLLs and Libraries

LTDISLTFILLTIMG

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.

See Also

Functions:

LImageListControl::ExportBitmapList, LImageListControl::GetItemOptions, LImageListControl::SetItemOptions

Topics:

Using the ImageList Control

 

Raster Image Functions: Displaying Images

Example

L_INT LImageListControl__ImportBitmapListExample(HWND hWnd, LBitmapList& BitmapList, LImageListControl& ImgList)  
{ 
   L_INT nRet ; 
 
   if(IsWindow(hWnd) && BitmapList.GetHandle())  
   { 
      LILIMPORTBITMAPLIST ImportList;  
 
      // Getting the number of bitmaps in the list.  
 
      if(BitmapList.GetItemsCount() > 0) // There are some bitmaps 
      { 
         ZeroMemory(&ImportList, sizeof(LILIMPORTBITMAPLIST));  
         ImportList.uStructSize = sizeof(LILIMPORTBITMAPLIST);  
         ImportList.hList = BitmapList.GetHandle() ; 
         ImportList.nStartIndex = 0; // Start from Index 0.  
         ImportList.nItemsToInsert = BitmapList.GetItemsCount();// Import all the list bitmaps.  
         ImportList.pText = _T("Imported Bitmap-Text"); 
         ImportList.pTextExt = _T("Imported Bitmap-TextExt"); 
 
         nRet = ImgList.ImportBitmapList(&ImportList); 
         if(nRet != SUCCESS) 
            return nRet; 
 
         /* update the control */ 
         RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);  
      } 
   } 
   return SUCCESS; 
} 
Help Version 20.0.2020.6.18
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help