IMAGELISTDRAWPARAMSIMAGELISTDRAWPARAMS*
*Contents  *Index  *Topic Contents
*Previous Topic: IMAGEINFO
*Next Topic: IP Address Controls

IMAGELISTDRAWPARAMS


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;

Contains information about an image list draw operation and is used with the ImageList_DrawIndirect function.

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
Coordinates where the image will be drawn.
cx and cy
Values that 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
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. This parameter can be an application-defined RGB value or one of the following values:
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. This parameter can be an application-defined RGB value or one of the following values:
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 specifying the drawing style and, optionally, the overlay image. See the comments section at the end of this topic for information on the overlay image. This parameter can be one or more of the following values:
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
Value specifying 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 include:
BLACKNESS Fills the destination rectangle using the color associated with index zero 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 one in the physical palette. (This color is white for the default physical palette.)

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, logically AND fStyle with the ILD_OVERLAYMASK value.

Version 4.70


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.