ImageList_AddMasked function (commctrl.h)
Adds an image or images to an image list, generating a mask from the specified bitmap.
int ImageList_AddMasked( HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask );
A handle to the image list.
A handle to the bitmap that contains one or more images. The number of images is inferred from the width of the bitmap.
The color used to generate the mask. Each pixel of this color in the specified bitmap is changed to black, and the corresponding bit in the mask is set to 1. If this parameter is CLR_DEFAULT, then the color of the pixel at (0,0) is used as the mask.
Returns the index of the first new image if successful, or -1 otherwise.
The ImageList_AddMasked function copies the bitmap to an internal data structure. Bitmaps with color depth greater than 8bpp are not supported. Be sure to use the DeleteObject function to delete hbmImage after the function returns.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|API set||ext-ms-win-shell-comctl32-init-l1-1-1 (introduced in Windows 10, version 10.0.14393)|