For example, I have two image lists CImageList il1 and CImageList il2. I want to merge them into one image list? How can I do that? Thanks for your inputs.
Printable View
For example, I have two image lists CImageList il1 and CImageList il2. I want to merge them into one image list? How can I do that? Thanks for your inputs.
It looks like there's an overload for Create that might do just that:
Check out the MSDN:Code:BOOL Create(
CImageList& imagelist1,
int nImage1,
CImageList& imagelist2,
int nImage2,
int dx,
int dy
);
http://msdn.microsoft.com/library/de...a3a.create.asp
Viggy
Thanks for your reply. The function Create is a MFC function but I am working with ATL. There is not similar overload in ATL for Create. Any idea how to do that in ATL? Thanks a lot.
Quote:
Originally Posted by MrViggy
I don't see a CImageList in the ATL reference. Are you really using an MFC CImageList, or did you roll your own?
Viggy
ATL does have CImageList and It is under ATLControls namespace but somehow ATL is poorly documented. That is why you didn't see a CImageList in the ATL reference.
Quote:
Originally Posted by MrViggy
Hmm, okay, I haven't really dabbled in ATL, however the MFC version of "Create" is just:
And, 'ImageList_Merge' looks like it's just an API call (in 'commctrl.h'):Code:BOOL CImageList::Create(CImageList& imagelist1, int nImage1,
CImageList& imagelist2, int nImage2, int dx, int dy)
{
return Attach(ImageList_Merge(imagelist1.m_hImageList, nImage1,
imagelist2.m_hImageList, nImage2, dx, dy));
}
HTH...Code:WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy);
Viggy
And, just to add to my last post:
http://msdn.microsoft.com/library/de...list_merge.asp
Viggy
i think you'd better roll your own to c# merge image lists. this version of codes work well for me. but i have no idea how to do this in atl.