L_ILM_SETSELBITMAP

Send this message to set the item selection bitmap and transparent color for the ImageList Control.

Parameters

wParam

COLORREF value to be used as the transparent color.

lParam

Pointer to the bitmap to use as the selection bitmap.

Returns

Value Meaning
< 0 An error occurred. Refer to Return Codes.

Comments

Use this message to set a user-defined bitmap to be used to display selected items when the selection style is set to SELECTIONSTYLE_USERBITMAP. The bitmap that you specify will be drawn with the specified color as transparent, and will be centered around each selected item.

The associated macro is:

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Functions

Topics

Example

this sample loads a bitmap from a resource as a DDB, converts it to a DDB, and then sets that as the selection bitmap

L_INT ILM_SETSELBITMAPExample(HWND hWnd, HWND hCtrl,HINSTANCE hInst) 
{ 
   HBITMAP hBitmap=NULL; 
   BITMAPHANDLE Bitmap; 
   HDC hDC=NULL; 
   LILSELOPTION Opt; 
   
   if(IsWindow(hCtrl)) 
   { 
      /* get current selection options */ 
      SendMessage(hCtrl, L_ILM_GETSELOPTIONS, 0, (LPARAM)&Opt);  
 
      hBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FLAG)); 
 
      if(hBitmap) 
      { 
         hDC = GetDC(hWnd); 
         if(L_ConvertFromDDB(hDC, &Bitmap, sizeof(BITMAPHANDLE), hBitmap, NULL)==SUCCESS) 
         { 
            SendMessage(hCtrl, L_ILM_SETSELBITMAP, (WPARAM)RGB(0,255,0), (LPARAM)&Bitmap);  
            L_FreeBitmap(&Bitmap);  
         } 
         DeleteObject(hBitmap);  
         ReleaseDC(hWnd, hDC);  
      } 
      Opt.uSelectionStyle = SELECTIONSTYLE_USERBITMAP; 
      SendMessage(hCtrl, L_ILM_SETSELOPTIONS, 0, (LPARAM)&Opt);  
      RedrawWindow(hCtrl, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);  
   } 
   return SUCCESS; 
} 

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help