Exemplo n.º 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();
            }
Exemplo n.º 2
0
        public PolylineShape(SVG svg, XmlNode node) : base(svg, 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();
        }
Exemplo n.º 3
0
        public PolygonShape(SVG svg, XmlNode node) : base(svg, node)
        {
            if (DefaultFill == null)
            {
                DefaultFill       = new Fill(svg);
                DefaultFill.Color = svg.PaintServers.Parse("black");
            }

            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();
        }
Exemplo n.º 4
0
 public MoveTo(char command, ShapeUtil.StringSplitter value) : base(command)
 {
     Point = value.ReadNextPoint();
 }
Exemplo n.º 5
0
 public CurveTo(char command, ShapeUtil.StringSplitter value, Point ctrlPoint1) : base(command)
 {
     CtrlPoint1 = ctrlPoint1;
     CtrlPoint2 = value.ReadNextPoint();
     Point      = value.ReadNextPoint();
 }