I have built a simple StreamGeometry, using MSDN example:
StreamGeometry geometry = new StreamGeometry();
geometry.FillRule = FillRule.EvenOdd;
using (StreamGeometryContext ctx = geometry.Open())
{
ctx.BeginFigure(new Point(10, 100), true /* is filled */, true /* is closed */);
ctx.LineTo(new Point(100, 100), true /* is stroked */, false /* is smooth join */);
ctx.LineTo(new Point(100, 50), true /* is stroked */, false /* is smooth join */);
}
return geometry;
How can I get back the Point objects from the StreamGeometry?
I can’t seem to find any suitable method. All I can see is ToString(), which gives me the mini-language format : {M10,100L100,100 100,50z}
here’s what we did for a similar task. Please note, your geometries mustn’t contain nothing bar the lines. Basically it’s a tiny level of abstraction on top of Geometry, Stroke() returns a tuple with the mimilanguage and the collection of Points. You can make Navigator bindable by writing a simple behavior, please let me know if interested and I’ll adjust my answer for it.
Update 1 – the function, which accepts minilang expression and returns a Point array:
Code:
Markup: