Пример #1
0
            public LineTo(char command, ShapeUtil.StringSplitter value) : base(command)
            {
                if (char.ToLower(command) == 'h')
                {
                    PositionType = eType.Horizontal;
                    double v = value.ReadNextValue();
                    Points = new Point[] { new Point(v, 0) };
                    return;
                }
                if (char.ToLower(command) == 'v')
                {
                    PositionType = eType.Vertical;
                    double v = value.ReadNextValue();
                    Points = new Point[] { new Point(0, v) };
                    return;
                }

                PositionType = eType.Point;
                List <Point> list = new List <Point>();

                while (value.More)
                {
                    Point p = value.ReadNextPoint();
                    list.Add(p);
                }
                Points = list.ToArray();
            }
Пример #2
0
        public PolygonShape(XmlNode node) : base(node)
        {
            string points = XmlUtil.AttrValue(node, SVGTags.sPoints, string.Empty);

            ShapeUtil.StringSplitter split = new ShapeUtil.StringSplitter(points);
            List <Point>             list  = new List <Point>();

            while (split.More)
            {
                list.Add(split.ReadNextPoint());
            }
            Points = list.ToArray();
        }
Пример #3
0
 public MoveTo(char command, ShapeUtil.StringSplitter value) : base(command)
 {
     Point = value.ReadNextPoint();
 }
Пример #4
0
 public CurveTo(char command, ShapeUtil.StringSplitter value, Point ctrlPoint1) : base(command)
 {
     CtrlPoint1 = ctrlPoint1;
     CtrlPoint2 = value.ReadNextPoint();
     Point      = value.ReadNextPoint();
 }