Geometry.GetFlattenedPathGeometryreturns a "polygonal approximation of a geometry object". Then you can iterate over shapes and segments of flattened geometry: each shape must consist of one PolyLineSegment, from which you can iterate over the Points property to get points along the path. In this way:
PathGeometry g = Path.Data.GetFlattenedPathGeometry();
foreach (var f in g.Figures)
foreach (var s in f.Segments)
if (s is PolyLineSegment)
foreach (var pt in ((PolyLineSegment)s).Points)
Debug.WriteLine(pt);
source
share