TAdvTreeView & pictures

I'm trying to populate each cell of one column with an image. 


I've tried using <IMG src= method, but I can't find the correct way to define the source. The document indicates that you can use a TPictureContainer, or, I guess normal URL? 

Is there any documentation covering use of the TPictureContainer? And is there any other way for putting an image into a TAdvTreeView cell?

thanks

stephen







Hi, 


You can specify an image file (LoadFromFile) for the CollapsedIcons / ExpandedIcons:

AdvTreeView1.Nodes[0].CollapsedIcons
AdvTreeView1.Nodes[0].ExpandedIcons

Or if you want to include an image in HTML:
<img src="MyImage"/>

And specify an identical name in the picture container item.

Additionally you can also use the picturecontainer for the CollapseIconName / ExpandedIconName

The Large version of each property is for High DPI support

Thanks

I've tried the Icons version, but the images are too large and I can't get the images the right size, and to stay on the screen (I used the BeforeNodeIconDraw event). I can get round it by resizing the images  on the disk prior to the treeview load, so there's a way round, but it's a bit mucky.

Trying the HTML approach, I can't make it  work for the images.  I've checked it works ok for other things (text bold, etc). I'm using:

                                              tp := PictureContainer1.Items.Add;
                                              tp.Picture.LoadFromFile(sRes);
                                              tp.Name := sRes;

                                              pn.Text[3] := '<IMG src="PictureContainer1:' + sRes + '">';


Could you tell me what's wrong with it?

thanks

stephen

OK, answered my own question:


When setting up the grid, these need to be included. 

     gridResults.NodesAppearance.HeightMode := tnhmVariable;
     gridResults.PictureContainer := PictureContainer1;

Then for each node that you put into the tree:

tp := PictureContainer1.Items.Add;
tp.Picture.LoadFromFile(sFilename);
tp.Name := IntToStr(iCounter);
pn.Text[iCol] := '<IMG src="' + IntToStr(iCounter) + '" width = "100" height="150" />';

where tp is a TPictureItem 
and pn is a TAdvTreeViewNode

works very nicely