Share via


ImageList_LoadImage

This function creates an image list from the specified bitmap or icon resource.

HIMAGELIST WINAPI ImageList_LoadImage(
HINSTANCE hi, 
LPCSTR lpbmp, 
int cx, 
int cGrow, 
COLORREF crMask, 
UINT uType, 
UINT uFlags );

Parameters

  • hi
    [in] Handle to the instance of an application or DLL that contains an image.

  • lpbmp
    [in] Long pointer to the image to load.

    If the uFlags parameter includes LR_LOADFROMFILE, lpbmp is the address of a null-terminated string that names the file containing the image to load.

    If the hi parameter is non-NULL and LR_LOADFROMFILE is not specified, lpbmp is the address of a null-terminated string that contains the name of the image resource in the hi module.

    If hi is NULL and LR_LOADFROMFILE is not specified, the low-order word of this parameter must be the identifier of an OEM image to load. To create this value, use the MAKEINTRESOURCE macro with one of the OEM image identifiers defined in Winuser.h. These identifiers have the following prefixes:

    • OBM_ for OEM bitmaps
    • OIC_ for OEM icons
  • cx
    [in] Width of each image. The height of each image and the initial number of images are inferred by the dimensions of the specified resource.

  • cGrow
    [in] Number of images by which the image list can grow when the system needs to make room for new images. This parameter represents the number of new images that the resized image list can contain.

  • crMask
    [in] Color used to generate a mask. Each pixel of this color in the specified bitmap or icon is changed to black, and the corresponding bit in the mask is set to 1. If this parameter is the CLR_NONE value, no mask is generated. If this parameter is the CLR_DEFAULT value, the color of the pixel at the upper-left corner of the image is treated as the mask color.

  • uType
    [in] Flag that specifies the type of image to load. This parameter can be one of the following values:

    Value Description
    IMAGE_BITMAP Loads a bitmap.
    IMAGE_ICON Loads an icon.
  • uFlags
    [in] Unsupported; set to 0.

Return Values

The handle to the image list indicates success. NULL indicates failure.

Remarks

You can only use this function with icons, not cursors.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Commctrl.h   Commctrl.lib, Imgctl.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

ImageList_LoadBitmap, MAKEINTRESOURCE

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.