Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Create border around the diagram (Read 2711 times)
Steve_VG
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 10
Joined: May 21st, 2013
Create border around the diagram
May 30th, 2013 at 12:09am
Print Post  
Hi,

I am relatively new to diagrammming in Mind Fusion: How do I go about creating a simple border around my entire diagram? This is mainly required for when the diagram is exported to PDF.
« Last Edit: May 30th, 2013 at 3:35am by Steve_VG »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Create border around the diagram
Reply #1 - May 30th, 2013 at 10:26am
Print Post  
Hi,

You could add a temporary node as a border before exporting, and remove it after that:

Code
Select All
diagram.AutoResize = AutoResize.None;

var border = diagram.Factory.CreateShapeNode(diagram.Bounds);
border.Brush = Brushes.Transparent;
border.ZIndex = -1000;

PdfExporter.Export(...);
diagram.Nodes.Remove(border); 



There are other ways to draw border on screen, e.g. by handling the DrawBackground event, but only the temp. node method seems to work in my tests when exporting.

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


I Love MindFusion!

Posts: 10
Joined: May 21st, 2013
Re: Create border around the diagram
Reply #2 - Jun 12th, 2013 at 12:43am
Print Post  
Great, thanks Stoyan.

The temporary node works nearly perfectly - even after setting the temp nodes obstacle property to false, the LinkLabels I have in the diagram overlap other nodes they are adjacent to. This was a minor issue for me as I could place the labels on segments further away from any node, however this could be a problem in the future.

Is there any way to prevent the labels from overlapping adjacent nodes in this scenario?

Thanks,

Steve
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Create border around the diagram
Reply #3 - Jun 12th, 2013 at 7:40am
Print Post  
Obstacle is considered only by the routing function, and it seems the large node prevents LinkLabel.AutoArrange from finding correct positions. For the time being you could create four thin nodes at each side of the diagram instead a large one covering all of it.

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


I Love MindFusion!

Posts: 10
Joined: May 21st, 2013
Re: Create border around the diagram
Reply #4 - Jun 13th, 2013 at 12:22am
Print Post  
Nice idea. Thanks for your help!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint