How to set specific point to a node in MSAGL

383 views Asked by At

I'm trying to draw some graph using the Microsoft's MSAGL. Here I have some nodes, but is there a way to set their position using Points?

I need to place up to hundred points to specific places in this picture and let the algorithm to route everything.

For example:

mainGraph = new Microsoft.Msagl.Drawing.Graph("mainGraph");
mainGraph.AddNode(new Node("NODE"));

GViewer1.Graph = mainGraph;

mainGraph.FindNode("NODE").GeometryNode.Center = new Point(10, 10); // <- Doesn't do anything.

Am I missing something?

1

There are 1 answers

1
مصطفي انصاري On

You just need to define the node's center using a Microsoft.Msagl.Core.Geometry Point, like below:

graph.FindNode("Node0").GeometryNode.Center = new Microsoft.Msagl.Core.Geometry.Point(100, 100);