Compartilhar via


ImageList_LoadImage (Compact 2013)

3/28/2014

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

Syntax

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 hi parameter is non-NULL, 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, 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 Value

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

Remarks

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

Requirements

Header

commctrl.h

Library

commctrl.lib,
Imgctl.lib

See Also

Reference

Image List Functions
ImageList_LoadBitmap
MAKEINTRESOURCE