Last post Dec 20, 2013 10:52 AM by ikondrasovas
Dec 20, 2013 10:52 AM|ikondrasovas|LINK
I am working in a new WEB API project (.NET 4.5) and I need to provide some services to get information from some drawings containing lines, arcs, etc.
A PathGeometry object contains everything I need. Now I must find a way to serialize this object informaton to the client side app (Windows Store App) using my APIs.
There is Path Markup Syntax that can represent geometries. I believe this could be great to use, instead of serializing the object itself. I can create a PathGeometry object on
the client side from a string containing this syntax, but the opposite seems not to be true. In other words, I cannot get this syntax for a giving PathGeometry object so I can use to send to my client.
Here is the code snippet that creates my PathGeometry:
PathGeometry pathGeometry = new PathGeometry();
PathFigureCollection figures = new PathFigureCollection();
PathFigure fig = new PathFigure();
fig.StartPoint = new System.Windows.Point(100, 100);
ArcSegment arcSeg = new ArcSegment();
arcSeg.Point = new System.Windows.Point(200, 100);
arcSeg.Size = new System.Windows.Size(100, 50);
arcSeg.IsLargeArc = true;
arcSeg.SweepDirection = SweepDirection.Clockwise;
arcSeg.RotationAngle = 0;
pathGeometry.Figures = figures;
Is there a way I can get the the path markup syntax in string format?