BoldDeskWe are launching BoldDesk on Product Hunt soon.
Learn more & follow us.
how can I get the actual size of my diagram?For example:
rect = new Rectantle(0,0,20,20);
I want to get the size of the diagram, so, width = 20, height = 20.
If I have:
rect1 = new Rectantle(0,0,20,20);
rect 2= new Rectantle(20,0,20,20);
I'll have width = 40, height = 20.
This is a very simple sample;
We suggest you to get the size of the diagram by
Diagram.Model.LogicalSize.Width and Diagram.Model.LogicalSize.Height.
Here is the code snippet:
//Finding the size of the diagram
SizeF DiagramSize = new SizeF(diagram1.Model.LogicalSize.Width, diagram1.Model.LogicalSize.Height);
I should know the size of a DirectedTreeLayout with lots of nodes and levels.
We suggest you to get the size of the layout by passing the Layoutmanager.Model.Nodes and the MeasureUnit in Diagram.Controller.GetBoundingRect property.
DirectedTreeLayoutManager dtlm = new DirectedTreeLayoutManager(this.diagram1.Model, 0, 50, 60);
RectangleF Rect = new RectangleF();
//Finding the size of the layout Rect=this.diagram1.Controller.GetBoundingRect(dtlm.Model.Nodes, MeasureUnits.Pixel);
SizeF LayoutSize = new SizeF(Rect.Width, Rect.Height);
Here is the Sample: