You can add icons or other bit images to an image list. You add bit images by specifying the handles to two bitmaps in a call to the ImageList_Add function. The first bitmap contains one or more images to add to the image bitmap, and the second bitmap contains the masks to add to the mask bitmap. Windows CE ignores the second bitmap handle for nonmasked images; you can set it to NULL.
The ImageList_AddMasked function adds bit images to a masked image list. This function is similar to ImageList_Add, in which you do not specify a mask bitmap. Instead, you specify a color that the system combines with the image bitmap to automatically generate the masks. Windows CE changes each pixel of the specified color in the image bitmap to black, and sets the corresponding bit in the mask to one. As a result, any pixel in the image that matches the specified color is transparent when the image is drawn.
The ImageList_AddIcon function adds an icon to an image list. If the image list is masked, ImageList_AddIcon adds the mask provided with the icon to the mask bitmap. If the image list is nonmasked, the mask for the icon is not used when drawing the image.
You can create an icon based on an image and mask in an image list by using the ImageList_GetIcon function. The function returns the handle to the icon. ImageList_Add, ImageList_AddMasked, and ImageList_AddIcon assign an index to each image as it is added to an image list. When more than one image is added at a time, the functions return the index of the first image. The ImageList_Remove function removes an image from an image list.
The ImageList_Replace and ImageList_ReplaceIcon functions replace an image in an image list with a new image. ImageList_Replace replaces an image with a bit image and mask, and ImageList_ReplaceIcon replaces an image with an icon. You can use the ImageList_Copy function to move or copy images within an image list.
The ImageList_Merge function merges two images, storing the new image in a new image list. The new image is created by drawing the second image transparently over the first. The mask for the new image is the result of performing a logical OR operation on the bits of the masks for the two original images.
The ImageList_GetImageInfo function fills an IMAGEINFO structure with information about a single image, including the handles of the image and mask bitmaps, the number of color planes and bits per pixel, and the bounding rectangle of the image within the image bitmap. You can use this information to directly manipulate the bitmaps for the image. The ImageList_GetImageCount function retrieves the number of images in an image list.
You can use the ImageList_DrawIndirect function to specifies custom drawing properties for an image in an image list. This function takes a pointer to an IMAGELISTDRAWPARAMS structure as a parameter. The IMAGELISTDRAWPARAMS structure contains information about how to draw the image.