Given an instance of the System.Windows.Media.Geometry class, is there an easy way to convert it to a list of paths and points? For example, how could I just break this down into a LineSegments list for custom rendering.
FormattedText formattedText = new FormattedText( "Hello", ...); Geometry textGeometry = formattedText.BuildGeometry(new System.Windows.Point(0, 0));
How to list each of the circuits (where O will be the internal / external environment) and each of the points in each circuit?
According to the answer below;
var flatten = textGeometry.GetFlattenedPathGeometry(); PathFigureCollection pfc = flatten.Figures; foreach (PathFigure pf in pfc) { foreach (PathSegment ps in pf.Segments) { if (ps is LineSegment)
source share