views:

38

answers:

1

I want to be able to dynamically modify the image in a c# treeview. Specifically, I would like to reduce the opacity in certain cases of certain images.

I know that I can add extra icons to the imagelist that is bound to the treeview, but as cases like this add up, the extra icons will get to be too much.

Is there a way to access the image in a treeview node without completely ownerdrawing the whole thing? or if I do have to ownerdraw the entire tree, is there a template I can modify?

TIA!

A: 

If you look at your designer code you should see something like this:

this.imageListTree.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListTree.ImageStream")));

You might be able to modify the objects within imageListTree.ImageStream and rebind it to the tree.

If you look at your resource file you should see a Base64 string within the XML file. You can probably stream that Base64 and manipulate it on the fly.

Icono123
Looks like your going to have to write your own: x-microsoft.net.object.binary.base64 and replace what Microsoft already has.
Icono123