Skip to content

Latest commit

 

History

History
88 lines (67 loc) · 3.56 KB

nf-commoncontrols-iimagelist-addmasked.md

File metadata and controls

88 lines (67 loc) · 3.56 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:commoncontrols.IImageList.AddMasked
IImageList::AddMasked (commoncontrols.h)
Adds an image or images to an image list, generating a mask from the specified bitmap. (IImageList.AddMasked)
AddMasked
AddMasked method [Windows Controls]
AddMasked method [Windows Controls]
IImageList interface
IImageList interface [Windows Controls]
AddMasked method
IImageList.AddMasked
IImageList::AddMasked
comctl_IImageList_AddMasked
comctl_IImageList_AddMasked_cpp
commoncontrols/IImageList::AddMasked
controls.IImageList_AddMasked
controls.comctl_IImageList_AddMasked
controls\IImageList_AddMasked.htm
Controls
VS|Controls|~\controls\imagelist\ifaces\iimagelist\addmasked.htm
12/05/2018
AddMasked, AddMasked method [Windows Controls], AddMasked method [Windows Controls],IImageList interface, IImageList interface [Windows Controls],AddMasked method, IImageList.AddMasked, IImageList::AddMasked, comctl_IImageList_AddMasked, comctl_IImageList_AddMasked_cpp, commoncontrols/IImageList::AddMasked, controls.IImageList_AddMasked, controls.comctl_IImageList_AddMasked
commoncontrols.h
Windows
Windows Vista [desktop apps only]
Windows Server 2003 [desktop apps only]
CommonControls.idl
Comctl32.dll (version 6.0 or later)
Windows
19H1
IImageList::AddMasked
commoncontrols/IImageList::AddMasked
c++
APIRef
kbSyntax
COM
Comctl32.dll
IImageList.AddMasked

IImageList::AddMasked

-description

Adds an image or images to an image list, generating a mask from the specified bitmap.

-parameters

-param hbmImage [in]

Type: HBITMAP

A handle to the bitmap that contains one or more images. The number of images is inferred from the width of the bitmap.

-param crMask [in]

Type: COLORREF

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.

-param pi [out]

Type: int*

A pointer to an int that contains the index of the first new image when it returns, if successful, or -1 otherwise.

-returns

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

-remarks

Note  The bitmap passed in hbmImage will be modified.
 
IImageList::AddMasked copies the bitmap to an internal data structure. Bitmaps with color depth greater than 8bpp are not supported. You must use the DeleteObject function to delete hbmImage and crMask after the method returns.

To use IImageList::AddMasked, specify Comctl32.dll version 6 in the manifest. For more information on manifests, see Enabling Visual Styles.