CImageList::SetOverlayImage

Call this function to add the zero-based index of an image to the list of images to be used as overlay masks.

BOOL SetOverlayImage(
   int nImage,
   int nOverlay 
);

Параметры

  • nImage
    Zero-based index of the image to use as an overlay mask.

  • nOverlay
    One-based index of the overlay mask.

Возвращаемое значение

Nonzero if successful; otherwise 0.

Заметки

Up to four indices can be added to the list.

An overlay mask is an image drawn transparently over another image. Draw an overlay mask over an image by using the CImageList::Draw member function with the one-based index of the overlay mask specified by using the INDEXTOOVERLAYMASK macro.

Пример

// Add a new image to the image list.
int nIndex = m_myImageList.Add(AfxGetApp()->LoadStandardIcon(IDI_QUESTION));

if (nIndex != -1)
{
   // Make the new image an overlay image.
   m_myImageList.SetOverlayImage(nIndex, 1);

   // Draw the first image in the image list with an overlay image.
   m_myImageList.Draw(&dc, 0, CPoint(0, 0), INDEXTOOVERLAYMASK(1));
}

Требования

Header: afxcmn.h

См. также

Основные понятия

CImageList Class

CImageList Members

Hierarchy Chart

CImageList::Add