Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drawing Horiz Link From AnchorPoint (Read 1351 times)
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Drawing Horiz Link From AnchorPoint
Mar 26th, 2010 at 3:24pm
Print Post  
I am trying to create a horizontal link from a specific anchor point (on a shape node) to a point 25 units to the right. The rightmost point is not connected to a node. The code I am using is the following, but does not draw the link where I want.


       Dim l As DiagramLink
       Dim pt1, pt2 As PointF
       pt1 = New PointF(MyNode.Shape.AnchorPattern.Points(1).X, _
               MyNode.Shape.AnchorPattern.Points(1).Y)
       pt2 = New PointF(MyNode.Shape.AnchorPattern.Points(1).X + 25, _
                MyNode.Shape.AnchorPattern.Points(1).Y)
      l = dgm.Factory.CreateDiagramLink(pt1, pt2)

Could you please show me the right code? I know I am not using the correct offsets for the X and Y but can't figure them out. Or maybe there is a simpler way.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drawing Horiz Link From AnchorPoint
Reply #1 - Mar 26th, 2010 at 3:50pm
Print Post  
The anchor point coordinates are percents of the node width and height. Their coordinates in the diagram should look like this:

diagramX = nodeLeft + nodeWidth * anchorX / 100;
diagramY = nodeTop + nodeHeight * anchorY / 100;

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


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Re: Drawing Horiz Link From AnchorPoint
Reply #2 - Mar 26th, 2010 at 4:50pm
Print Post  
Thanks, that worked perfectly.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint