Ejemplo n.º 1
0
        /// <summary>
        /// 它创建了一个新的svg circle元素。
        /// </summary>
        public SVGCircle AddCircle(SVGUnit parent, ref SVGUnit last)
        {
            SVGCircle circle = new SVGCircle(this);

            AddElement(parent, circle, ref last);

            return(circle);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var circle = new SVGCircle(new Point(250.0, 550.0), 20.0,
                                       new Color(100, 255, 56, 0),
                                       new Color(0, 0, 0, 0),
                                       2
                                       );

            var ellipse = new SVGEllipse(new Point(450.0, 550.0), 20.0, 10.0,
                                         new Color(100, 255, 56, 0),
                                         new Color(0, 0, 0, 0),
                                         2
                                         );

            var points = new List <Point>()
            {
                new Point(70, 5), new Point(90, 41), new Point(136, 48),
                new Point(103, 80), new Point(111, 126), new Point(70, 105), new Point(29, 126), new Point(36, 80), new Point(5, 48), new Point(48, 41)
            };

            var pathdata = new List <Point>()
            {
                new Point(200, 100), new Point(250, 210), new Point(16, 210)
            };

            var path = new SVGPath(pathdata, new Color(255, 100, 56, 0), new Color(0, 0, 0, 0), 2);

            var polygon = new SVGPolygon(points, new Color(100, 255, 56, 0), new Color(0, 0, 0, 0), 2);

            var rect = new SVGRect(50.0, 20.0, 50.0, 20.0, new Color(100, 255, 56, 0), new Color(0, 0, 0, 0), 2);

            SVGIO.export(new List <SVGShape>()
            {
                polygon, ellipse, circle, rect, path
            }, "Z:\\Sources\\VectorGraphicsEditor\\IO Tests\\output\\mix.svg", 1000, 1001);

            // SVGIO.import("Z:\\Sources\\VectorGraphicsEditor\\IO Tests\\output\\Freesample.svg");
        }