How can I set Metatreex node iamge in VC++
|Brade||02/06/2006 07:51 am|
|Now I can change the background of the Metatree by using class CPictureHolder.But it seems too hard to set the nodes image.How can I set the param of Metatree.setimagelist().Would you be so kind to tell me what the IUnknown param should be.It would be better to get an VC demo.
Thank you all!
|Oleg Chernavin||02/07/2006 06:07 am|
|Can you please tell us how you create the component in VC++ and how did you try to assign the images? We will try to reproduce this and make a recommendation.
|brade||02/09/2006 01:29 am|
| Make an dialog resouce,add a Metatreex control to the dialog.
May be the following codes would be enough to you!
//metatree is a metatreex type member param of MyView
//use CPictureHolder class to set the background
//ID_BITMAP is my bitmap ID
//I just don`t know how to set the Imagelist for the nodes. Such as root ,child0,child1.
//that is how to set the param of the member funtion: SetImagelist(Iunknow newvalue);
In VB demo you set the imagelist for the metatree like this:
Set Images = CreateObject("MSComctlLib.ImageListCtrl")
Images.ImageHeight = 32
Images.ImageWidth = 32
Images.MaskColor = &HFF00FF
Set Pict = LoadPicture("MXDemo.bmp")
Images.ListImages.Add 1, , Pict
How can I make it in VC++
surpose ID_MYIMAGELIST is my imagelist id.how can I load the imagelist and set the nodes iamge.
Using SetImagelist() function?How to set the param of the function!
or other ways?
Thank you for your attention.
|Oleg Chernavin||02/10/2006 07:42 am|
|I think, we will need to add a function for image lists. Can you please wait a week until this is done?
|brade||02/10/2006 09:26 pm|
|Thank you for your kindness.
|Alex Filatkin||03/05/2006 12:33 pm|
We are very sorry for long delay.
This example demonstrates how to set imagelist in VC++.
So, please note that i am not experience in VC++ and my codes may contain some mistakes
// load images from resources
ii = il.GetListImages();
v1.vt = VT_INT;
v1.intVal = 1;
v2.vt = VT_DISPATCH;
v2.pdispVal = pdisp2;
// add images to imagelist
ii.Add(&v1, NULL, &v2);
// set imagelis "il" to m_metatree
IImageList and IImages classes i created by ClassWizard->Add Class -> From a type library MSCOMCTL.OCX