Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Shapenode with custom shape? (Read 1798 times)
Dominik Egger
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Oct 31st, 2013
Shapenode with custom shape?
Oct 31st, 2013 at 1:15pm
Print Post  
Hello,
I am currently trying to create a shapenode where the outline is defined by a Shape (Mindfusion.Diagramming.Shape). The coordinates of the shape are in the region of 0 - 1000.

However, if I assign the shape to the shapenode it gets drawn outside of the rectangle (see attachment).

My c# code is:

Code
Select All
 List<ElementTemplate> outlines = new List<ElementTemplate>();
        outlines.Add(new LineTemplate(points[0].X , points[0].Y , points[1].X , points[1].Y ));
        for (int i = 1; i < points.Count - 1; i++)
        {
          outlines.Add(new LineTemplate(points[i].X , points[i].Y , points[i + 1].X , points[i + 1].Y ));
        }

        Shape shape = new Shape(outlines.ToArray(), System.Drawing.Drawing2D.FillMode.Winding, "outline");

        ShapeNode shapeNode = diagram2.Factory.CreateShapeNode(0,0,100,100,shape);
 



  

ShapeNode.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shapenode with cusom shape?
Reply #1 - Oct 31st, 2013 at 1:17pm
Print Post  
Hi,

Shape coordinates specify percents of the node's width and height, you should set them to values in the 0-100 range.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Dominik Egger
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Oct 31st, 2013
Re: Shapenode with custom shape?
Reply #2 - Oct 31st, 2013 at 1:18pm
Print Post  
oh,
Should have reat the documentation more thorougly...

thanks  Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint