Partager via


CImageList::Copy

This member function implements the behavior of the Win32 function ImageList_Copy, as described in the Windows SDK.

BOOL Copy( 
   int iDst, 
   int iSrc, 
   UINT uFlags = ILCF_MOVE  
); 
BOOL Copy( 
   int iDst, 
   CImageList* pSrc, 
   int iSrc, 
   UINT uFlags = ILCF_MOVE  
);

Parameters

  • iDst
    The zero-based index of the image to be used as the destination of the copy operation.

  • iSrc
    The zero-based index of the image to be used as the source of the copy operation.

  • uFlags
    The bit flag value that specifies the type of copy operation to be made. This parameter can be one of the following values:

    Value

    Meaning

    ILCF_MOVE

    The source image is copied to the destination image's index. This operation results in multiple instances of a given image. ILCF_MOVE is the default.

    ILCF_SWAP

    The source and destination images exchange positions within the image list.

  • pSrc
    A pointer to a CImageList object that is the target of the copy operation.

Return Value

Nonzero if successful; otherwise zero.

Example

CImageList myImageList2;
myImageList2.Create(32, 32, ILC_COLOR8, 0, 4);

// Copy the first image from myImageList2 and make it 
// the first image of m_myImageList.
m_myImageList.Copy(0, &myImageList2, 0, ILCF_MOVE);

// Recopy the image to make it also the last image in m_myImageList.
m_myImageList.Copy(m_myImageList.GetImageCount() - 1, (int)0, 
   (UINT)ILCF_MOVE);

Requirements

Header: afxcmn.h

See Also

Reference

CImageList Class

Hierarchy Chart