Exemple #1
0
        internal static Geometry ParseGeometry(string pathString /*, IFormatProvider formatProvider*/)
        {
            FillRule fillRule = FillRule.EvenOdd;
            PathStreamGeometryContext context = new PathStreamGeometryContext();

            ParseStringToStreamGeometryContext(context, pathString /*, formatProvider*/, ref fillRule);
            var geometry = context.GetPathGeometry();

            geometry.FillRule = fillRule;
            return(geometry);
        }
        /// <summary>
        /// Parse a PathFigureCollection string.
        /// </summary>
        internal static PathFigureCollection ParsePathFigureCollection(
            string pathString,
            IFormatProvider formatProvider)
        {
            PathStreamGeometryContext context = new PathStreamGeometryContext();

            AbbreviatedGeometryParser parser = new AbbreviatedGeometryParser();

            parser.ParseToGeometryContext(context, pathString, 0 /* curIndex */);

            PathGeometry pathGeometry = context.GetPathGeometry();

            return(pathGeometry.Figures);
        }