Hi Bala,
Quote:Node's text should start from just beside the image (as in fig3) but if text is long enough, it should be truncated (as in fig 2).
You could use a TableNode with two cells, the first cell displaying the image and the second one displaying the text. If you prefer using ShapeNodes, try the following Shape definition.
var textOnTheRight = new Shape(
Shapes.Rectangle.Outline,// reuse the rectangular shape
null,// no decorations
new ElementTemplate[]// define text region
{
new LineTemplate(20, 0, 100, 0),
new LineTemplate(100, 0, 100, 100),
new LineTemplate(100, 100, 20, 100),
new LineTemplate(20, 100, 20, 0)
},
FillRule.EvenOdd,// doesn't matter here
"TextOnTheRight"// to access the shape later using Shape.FromId
);
textOnTheRight.ImageRectangle = new Rect(0, 0, 20, 20);
I hope that helps,
Stoyan