 |
ImageList_Add Add comment W32 Constants Translate this page |
 |
 |
|
Adds an image or images to an image list. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
int ImageList_Add(
HIMAGELIST himl,
HBITMAP hbmImage,
HBITMAP hbmMask
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER ImageList_Add IN comctl32;
INTEGER himl,;
INTEGER hbmImage,;
INTEGER hbmMask
|
 |
 |
 |
| Parameters: |
 |
himl
Handle to the image list.
hbmImage
Handle to the bitmap that contains the image or images. The number of images is inferred from the width of the bitmap.
hbmMask
Handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored.
|
 |
 |
| Return value: |
 |
Returns the index of the first new image if successful, or -1 otherwise.
|
 |
 |
| Usage: |
 |
hIcon = ExtractIcon(0, cSourceFile, nIconIndex)
IF hIcon <> 0
cBuffer = REPLICATE(CHR(0), ICONINFO_SIZE)
= GetIconInfo(m.hIcon, @cBuffer)
hbmMask = buf2dword(SUBSTR(cBuffer, 13,4))
hbmColor = buf2dword(SUBSTR(cBuffer, 17,4))
nResult = ImageList_Add(THIS.himl, hbmColor, hbmMask)
= DestroyIcon(hIcon)
ENDIF
|
 |
 |
| My comment: |
 |
The Usage shows how the image from an icon resource can be added to an Image List specified by its HIMAGELIST handle, THIS.himl.
See also: ImageList_Remove, ImageList_GetImageCount, LoadIcon, ExtractIcon, GetIconInfo, LoadImage
|
 |
 |
| Word Index links for the ImageList_Add : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2007-05-24 18:35:47 | | Modified: | 2007-06-11 20:01:21 | Visited in last 7 days: 6 |