Send this message to set the item selection bitmap and transparent color for the ImageList Control.
COLORREF value to be used as the transparent color.
Pointer to the bitmap to use as the selection bitmap.
Value | Meaning |
---|---|
< 0 | An error occurred. Refer to Return Codes. |
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.
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 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