public TrajectoryForm() { InitializeComponent(); _generator = new SvgGenerator(); _svg = SvgDocument.FromSvg <SvgDocument>(_generator.GenerateCode(RenderStrokeWidth)); _svgRasterizer = new SvgRasterizer(RenderGridStrokeWidth, RenderGridSize); RenderSvg(); }
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)); } }