CImageList::Copy的用法

BenzKuai 2009-03-27 10:24:17
这个CImageList::Copy(),有个功能是从一个aIamgelist中copy一个图到bImagelist中去。可是我如何用都不成功。
有用成功的吗?》给说说。。。。
...全文
175 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
cz 2010-09-27
  • 打赏
  • 举报
回复
偶也遇到同样问题,没办法只能复制一份,然后再把不需要的删除掉。。。

imageList2.Create(&imageList1);

imageList2.Remove(iIndex);
BenzKuai 2009-04-05
  • 打赏
  • 举报
回复
有知道的说一下呀。高手们。
BenzKuai 2009-03-29
  • 打赏
  • 举报
回复
各位,MSDN我当然会看了。不用贴这些东西。我也看懂英文。
我要说的关键是:应用。
要的是实际使用后的回复,你们从一个Imagelist向另一个Imagelist进行copy操作的时候成功过吗???写个demo试试吧。

在一个Imagelist内部copy就可以成功,两个Imagelist之间操作就不成功.为什么??
downmooner 2009-03-27
  • 打赏
  • 举报
回复
BOOL Copy(
int iDst, //将要拷贝到目标list的索引 基于0开始
CImageList* pSrc, //目标list
int iSrc, //要被拷贝的己方的图标索引 也是居于0开始的
UINT uFlags = ILCF_MOVE //标识 copy 另外还有个标识ILCF_SWAP是交换图像
);


详见MSDN啊
bbb332 2009-03-27
  • 打赏
  • 举报
回复
BOOL Copy( int iDst, int iSrc, UINT uFlags = ILCF_MOVE );

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

Return Value

Nonzero if successful; otherwise zero.

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.

Remarks

This member function implements the behavior of the Win32 functionImageList_Copy, as described in the Platform SDK.

Example

// The pointer to my image list.
extern CImageList* pmyImageList;
// The pointer to another image list.
extern CImageList* pmyImageList2;

// Copy the first image from pmyImageList2 and make it
// the first image of pmyImageList.
pmyImageList->Copy(0, pmyImageList2, 0, ILCF_MOVE);

// Recopy the new image of pmyImageList to make it also
// the last image in pmyImageList.
// Recopy the image to make it also the last image in pmyImageList.
pmyImageList->Copy(pmyImageList->GetImageCount()-1,
(UINT) 0, ILCF_MOVE);

64,636

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧