Esempio n. 1
0
        private void sVGToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter   = @"Scalable Vector Graphics Format(*.svg)|*.svg";
            saveFileDialog1.Title    = "Export Diagram As:";
            saveFileDialog1.FileName = "Diagram";
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                ToSvg tosvg = new ToSvg();
                // Get Diagram Nodes Bounding Rectangle.
                RectangleF rectBounding = this.diagram1.Model.GetBoundingRect();
                Graphics   gfx          = tosvg.GetRealGraphics(new Size((int)rectBounding.Width, (int)rectBounding.Height));
                this.diagram1.ExportDiagramToGraphics(gfx);
                tosvg.Save(saveFileDialog1.FileName);
            }
            else
            {
                return;
            }
        }
Esempio n. 2
0
        // Exports the Diagram as Svg file format
        #region ExportSvg
        private void ExportSvg()
        {
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter   = @"Scalable Vector Graphics Format(*.svg)|*.svg";
            saveFileDialog1.Title    = "Export Diagram As:";
            saveFileDialog1.FileName = "Diagram";

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                ToSvg tosvg = new ToSvg();
                // Get Diagram Nodes Bounding Rectangle.
                RectangleF rectBounding = this.diagram1.Model.GetBoundingRect();
                Graphics   gfx          = tosvg.GetRealGraphics(new Size((int)rectBounding.Width, (int)rectBounding.Height));
                AddInfotoImage();
                this.diagram1.ExportDiagramToGraphics(gfx);
                tosvg.Save(saveFileDialog1.FileName);
                RemoveInfofromImage();
            }
            else
            {
                return;
            }
        }