getting nodes points

hello,

I am using Syncfusion polyline tools to draw shapes, i want to be able to save the shape points in a PointF[] vector created in another class, i want to be able to update those changes each time i drag the node on the diagram.
My question is: how can i get the points of the node when it's drawed and when it's draged/droped..
Thank you a lot for your help.

1 Reply

AJ Ajish Syncfusion Team August 27, 2007 11:11 PM UTC

Hi Elie,

You can make use of the pinpoint changing event to do this, Here is the sample code for your reference,

private void MainForm_Load(object sender, EventArgs e)
{
((DocumentEventSink)model1.EventSink).PinPointChanging += new PinPointChangingEventHandler(MainForm_PinPointChanging);

}

void MainForm_PinPointChanging(PinPointChangingEventArgs evtArgs)
{
Console.WriteLine(evtArgs.NodeAffected.ToString());

if (evtArgs.NodeAffected is PolylineNode)
{
PolylineNode node = evtArgs.NodeAffected as PolylineNode;
MessageBox.Show("PinpointChanging event is fired" + "\n" + "Node name: " + evtArgs.NodeAffected.Name.ToString());


foreach (System.Drawing.PointF p in node.GetPoints())
{
Console.WriteLine("("+p.X.ToString()+"," + p.Y.ToString()+")");
}
}
}

and here is the sample for your reference,

http://websamples.syncfusion.com/samples/Diagram.Windows/F67648/main.htm

Kinldy take a look and let me if you need any further assistance.

Regards,
Ajish.


Loader.
Up arrow icon