Partager via


CImageList::DrawEx

Draws an image list item in the specified device context.

BOOL DrawEx( 
   CDC* pDC, 
   int nImage, 
   POINT pt, 
   SIZE sz, 
   COLORREF clrBk, 
   COLORREF clrFg, 
   UINT nStyle  
);

Parameters

  • pDC
    Pointer to the destination device context.

  • nImage
    Zero-based index of the image to draw.

  • pt
    Location at which to draw within the specified device context.

  • sz
    Size of the portion of the image to draw relative to the upper-left corner of the image. See dx and dy in ImageList_DrawEx in the Windows SDK*.*

  • clrBk
    Background color of the image. See rgbBk in ImageList_DrawEx in the Windows SDK*.*

  • clrFg
    Foreground color of the image. See rgbFg in ImageList_DrawEx in the Windows SDK*.*

  • nStyle
    Flag specifying the drawing style. See fStyle in ImageList_DrawEx in the Windows SDK*.*

Return Value

Nonzero if successful; otherwise 0.

Remarks

The function uses the specified drawing style and blends the image with the specified color.

Example

m_myImageList.DrawEx(&dc, 0, CPoint(0, 0), CSize(16, 16), CLR_DEFAULT, 
   CLR_DEFAULT, ILD_IMAGE);

Requirements

Header: afxcmn.h

See Also

Reference

CImageList Class

Hierarchy Chart

CImageList::BeginDrag

CImageList::EndDrag

CImageList::DragMove

CImageList::Draw