Пример #1
0
        public static DrawPathObject Create(SVGPath svp)
        {
            DrawPathObject dp;

            try
            {
                string s = svp.PathData.Trim();
                s = s.Replace("\r", "");
                s = s.Replace("\n", " ");
                s = s.Trim();
                string[] arr = s.Split(' ');

                dp = new DrawPathObject(arr)
                {
                    Name = svp.ShapeName
                };
                dp.SetStyleFromSvg(svp);
            }
            catch (Exception ex)
            {
                SVGErr.Log("DrawPathObject", "Create", ex.ToString(), SVGErr._LogPriority.Info);
                dp = null;
            }

            return(dp);
        }
Пример #2
0
        public override object Clone()
        {
            DrawPathObject newDrawPath = new DrawPathObject();

            foreach (PathCommands pc in _pointArray)
            {
                newDrawPath._pointArray.Add(new PathCommands(pc.P, pc.Pc));
            }
            newDrawPath.Stroke      = Stroke;
            newDrawPath.StrokeWidth = StrokeWidth;
            newDrawPath.Fill        = Fill;
            return(newDrawPath);
        }