Given a System.Windows.Media.Geometry
class instance, is there an easy way to convert this to a list of outlines and points? For example, how could I simply break this down into a list of LineSegments
for custom rendering.
FormattedText formattedText = new FormattedText( "Hello", ...);
Geometry textGeometry = formattedText.BuildGeometry(new System.Windows.Point(0, 0));
How to list each of the outlines (where O would be an inside/outside circle) and each of the points on each outline?
As per 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)