Пример #1
0
        public TrajectoryForm()
        {
            InitializeComponent();

            _generator     = new SvgGenerator();
            _svg           = SvgDocument.FromSvg <SvgDocument>(_generator.GenerateCode(RenderStrokeWidth));
            _svgRasterizer = new SvgRasterizer(RenderGridStrokeWidth, RenderGridSize);
            RenderSvg();
        }
Пример #2
0
        private void ExportImage(string path)
        {
            var code = _generator.GenerateCode(ExportStrokeWidth);
            var svg  = SvgDocument.FromSvg <SvgDocument>(code);

            using (var bm = SvgRasterizer.Rasterize(svg, ExportGridStrokeWidth, ExportGridSize))
                using (var f = File.OpenWrite(path))
                {
                    bm.Save(f, SelectImageFormat(path));
                }
        }