CImageList::Replace

BOOL Replace( int nImage, CBitmap* pbmImage, CBitmap* pbmMask );

int Replace( int nImage, HICON hIcon );

Return Value

The version returning BOOL returns nonzero if successful; otherwise 0.

The version returning int returns the zero-based index of the image if successful; otherwise  – 1.

Parameters

nImage

Zero-based index of the image to replace.

pbmImage

A pointer to the bitmap containing the image.

pbmMask

A pointer to the bitmap containing the mask. If no mask is used with the image list, this parameter is ignored.

hIcon

A handle to the icon that contains the bitmap and mask for the new image.

Remarks

Call this function to replace an image in an image list with a new image.

Call this member function after calling SetImageCount to assign the new, valid images to the placeholder image index numbers.

CImageList OverviewClass MembersHierarchy Chart

See Also   CImageList::Remove