IMAGELISTDRAWPARAMS

This structure contains information about an image list draw operation and is used with the ImageList_DrawIndirect function.

At a Glance

Header file: Commctrl.h
Windows CE versions: 2.0 and later

Syntax

typedef struct _IMAGELISTDRAWPARAMS {
DWORD cbSize;
HIMAGELIST himl;
int i;
HDC hdcDst;
int x;
int y;
int cx;
int cy;
int xBitmap;
int yBitmap;
COLORREF rgbBk;
COLORREF rgbFg;
UINT fStyle;
DWORD dwRop;
}
IMAGELISTDRAWPARAMS, FAR * LPIMAGELISTDRAWPARAMS;

Members

cbSize

Size of this structure, in bytes.

himl

Handle to the image list that contains the image to be drawn.

i

Zero-based index of the image to be drawn.

hdcDst

Handle to the destination device context.

x and y

Specify the coordinates that the image will be drawn at.

cx and cy

Specify the number of pixels to be drawn, relative to the upper-left corner of the drawing operation as specified by xBitmap and yBitmap. If cx and cy are zero, ImageList_DrawIndirect draws the entire valid section. The function does not ensure that the parameters are valid.

xBitmap and yBitmap

Specify the coordinates that specify the upper-left corner of the drawing operation with respect to the image itself. Pixels of the image that are to the left of xBitmap and above yBitmap are not drawn.

rgbBk

Image background color. It can be an application-defined RGB value or one of the following values:

Value Description
CLR_DEFAULT Default background color. The image is drawn using the image list background color.
CLR_NONE No background color. The image is drawn transparently.

This parameter is used only if the image list identified by himl was created with the ILC_MASK value.

rgbFg

Image foreground color. It is an application-defined RGB value or one of the following values:

Value Description
CLR_DEFAULT Default foreground color. The image is drawn using the system highlight color as the foreground color.
CLR_NONE No blend color. The image is blended with the color of the destination device context.

This parameter is used only if fStyle includes the ILD_BLEND25 or ILD_BLEND50 flag.

fStyle

Flag that specifies the drawing style and, optionally, the overlay image. It can be a combination of one or more of the following values:

Value Description
ILD_BLEND25 Draws the image, blending 25 percent with the blend color specified by rgbFg. This value has no effect if the image list does not contain a mask.
ILD_FOCUS Same as ILD_BLEND25.
ILD_BLEND50 Draws the image, blending 50 percent with the blend color specified by rgbFg. This value has no effect if the image list does not contain a mask.
ILD_SELECTED Same as ILD_BLEND50.
ILD_BLEND Same as ILD_BLEND50.
ILD_MASK Draws the mask.
ILD_NORMAL Draws the image using the background color for the image list. If the background color is the CLR_NONE value, the image is drawn transparently using the mask.
ILD_ROP Draws the image using the raster-operation code specified by the dwRop member.
ILD_TRANSPARENT Draws the image transparently using the mask, regardless of the background color. This value has no effect if the image list does not contain a mask.

dwRop

Specifies a raster-operation code. These codes define how the color data for the source rectangle will be combined with the color data for the destination rectangle to achieve the final color. This member is ignored if the fStyle member does not include the ILD_ROP flag.

Some common raster operation codes are listed below:

Value Description
BLACKNESS Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)
DSTINVERT Inverts the destination rectangle.
MERGECOPY Merges the source rectangle colors with the specified pattern by using the Boolean AND operator.
MERGEPAINT Merges the inverted source rectangle colors with the destination rectangle colors by using the Boolean OR operator.
NOTSRCCOPY Copies the inverted source rectangle to the destination.
NOTSRCERASE Combines the source and destination rectangle colors by using the Boolean OR operator. Inverts the resultant color.
PATCOPY Copies the specified pattern into the destination bitmap.
PATINVERT Combines the specified pattern colors with the destination rectangle colors by using the Boolean XOR operator.
PATPAINT Combines the pattern colors with the inverted source rectangle colors by using the Boolean OR operator. Combines the result with the destination rectangle colors by using the Boolean OR operator.
SRCAND Combines the source and destination rectangle colors by using the Boolean AND operator.
SRCCOPY Copies the source rectangle directly to the destination rectangle.
SRCERASE Combines the destination rectangle’s inverted colors with the source rectangle colors by using the Boolean AND operator.
SRCINVERT Combines the source and destination rectangle colors by using the Boolean XOR operator.
SRCPAINT Combines the source and destination rectangle colors by using the Boolean OR operator.
WHITENESS Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)

Remarks

An overlay image is an image that is drawn on top of the primary image specified in the i member of this structure. To specify an overlay image, logically OR the fStyle member with the INDEXTOOVERLAYMASK macro, passing the one-based index of the overlay image in the macro. This image must have been previously specified as an overlay image using the ImageList_SetOverlayImage API.

To extract the overlay image from the fStyle member, use the logical AND to combine fStyle with the ILD_OVERLAYMASK value.