I read the help document and there are several different places to show developers how to use Shape proeprty. All code in these smaples can work well. But if I just change a little it can not work well. Such as, there is a smaple in a chapter named Tutorial 7: Custom shape nodes. I copy these sample code and run it without any change, it can work, I show the image below:
and those code is:
node1.Shape = new Shape(
new ElementTemplate[] {
new LineTemplate(0, 0, 100, 0),
new LineTemplate(100, 0, 100, 50),
new LineTemplate(100, 50, 50, 50),
new LineTemplate(50, 50, 50, 100),
new LineTemplate(50, 100, 0, 100),
new LineTemplate(0, 100, 0, 50)
},
FillMode.Winding, "Custom");
But if I change the coordinate of line like below then it can not work:
node1.Shape = new Shape(
new ElementTemplate[] {
new LineTemplate(0, 0, 76, 0),
new LineTemplate(76, 0, 76, 22),
new LineTemplate(76, 22, 22, 22),
new LineTemplate(22, 22, 22, 76),
new LineTemplate(22, 76, 0, 76),
new LineTemplate(0, 76, 0, 22)
},
FillMode.Winding, "Custom");
and the image is below:
look at it, these adjustment handlers do not surround the whole shape exactly, this is the problem. In my case, all lines that consist outline of a shape are vertical or horizontal line, and I need to set any value to start poit and end point of a line. How to solve the problem and do it? Thanks a lot