|
Hello,
I'm trying to create a custom shape in my code-behind and am having a great deal of difficuly. I found this sample code (from the help) and when I run it I am able to pull the pre-defined shape (using ShapeTemplate.FromId()), but second box just shows up as a regular old square every time instead of displaying the custom shape.
The only difference between the code from the example below and mine is that I use fc.CreateBox(x,y, w, h) instead of using boxes already in the flowchart.
What gives?
private void example_Click(object sender, System.EventArgs e)
{
Box box0 = fc.CreateBox(0,0, 200, 200);
Box box1 = fc.CreateBox(0, 250, 200, 200);
// use one of the predefined shapes
box0.Shape = ShapeTemplate.FromId("MultiDocument");
// create a custom shape
box1.Shape = new ShapeTemplate(
new ElementTemplate[] {
new LineTemplate( 0, 100, 60, 100),
new BezierTemplate( 60, 100, 80, 100, 100, 75, 100, 50),
new BezierTemplate(100, 50, 100, 25, 80, 0, 60, 0),
new LineTemplate( 60, 0, 0, 0),
new LineTemplate( 0, 0, 0, 100) },
FillMode.Winding);
}
|