Quote:Ok we are are onto something but check out the attachment for the problem still persisting.
My idea was replacing the shape once the node is created, not keeping the one from the listbox. E.g. you load only the thumbnail shapes in the listbox, the actual shapes in the view, and handle NodeCreated like this:
if (node.Shape.Id = "Thumbnail_MyShape")
node.Shape = Shape.FromId("Actual_MyShape");
Quote:Played around with it more, it seems to do the job but see attachment, when resized the image in the shape sort of becomes detached from it.
Shape coordinates are specified as percents of node's size, and if you have a distance of 1 between the two rectangles, it might get larger than a pixel when the node is large.
Quote:One way I can think of is to restrict the resizing by handles by proportion or percentage. Can that be done? What I mean is if width is increased, so should height, proportionately when dragged using handles.
Yes, using NodeCosntraints as you found out. Another option might be to use a simple RoundRect shape for all nodes, and attach a locked node to show the thumbnail image to the main node's top-right corner (see DiagramNode.AttachTo method). That will allow resizing the node in all directions without resizing the attached image.
Quote:Plus I'm wondering why its cut from the bottom.
Check if there aren't any Y coordinates getting larger than 100%.
Quote:Solved (Problem of wanting the thumbnail to be different from shape)
Just keep in mind that changing some ShapeListBox properties will generate these images again - such as icon size or color.
I hope that helps,
Stoyan