LImageListControl::SetSelectionBitmap

#include "ltwrappr.h"

L_INT LImageListControl::SetSelectionBitmap(crTransparent, pBitmap)

COLORREF crTransparent;

/* transparent color */

LBitmapBase *pBitmap;

/* pointer to an LBitmapBase object */

Displays selected items using the specified user-defined bitmap.

Parameter

Description

crTransparent

Color value of the transparent color.

pBitmap

Pointer to an LBitmapBase object that references the bitmap to use as the selection bitmap.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Displays selected items using the specified user-defined bitmap when the selection style has been set to SELECTIONSTYLE_USERBITMAP using LImageListControl::SetSelectionOptions. The specified bitmap will be drawn with the specified color as transparent, and will be centered around each selected item.

Required DLLs and Libraries

LTDIS
LTFIL
LTIMG

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

Class Members

Topics:

Using the ImageList Control

 

Using Color Values in LEADTOOLS

Example

LImageListControl m_ImgList;
   LILSELOPTION SelOpt;
   // get current options
   m_ImgList.
GetSelectionOptions(&SelOpt);
   // set some options
   if(SelOpt.uAllowSelection != ALLOWSELECTION_SINGLE)
      SelOpt.uAllowSelection = ALLOWSELECTION_SINGLE;
   LBitmapBase SelBitmap;
   SelBitmap.Load(TEXT("d:\\te
mp\\flagsel2.bmp"));
   m_ImgList.
SetSelectionBitmap(RGB(255,255,255), &SelBitmap);
   if(SelOpt.uSelectionStyle != SELECTIONSTYLE_USERBITMAP)
      SelOpt.uSelectionStyle = SELECTIONSTYLE_USERBITMAP;
   m_ImgList.
SetSelectionOptions(&SelOpt);