Ejemplo n.º 1
0
        public void SaveGraph()
        {
            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog
            {
                FileName   = DataModel.Instance.GetSaveFileNamePrefix(),
                DefaultExt = ".png",                 // Default file extension
                Filter     = "Portable Images|*.png" // Filter files by extension
            };

            if (dlg.ShowDialog() != true)
            {
                return;
            }

            SavePng.SaveToPng(this.graph, this.Background, dlg.FileName);
        }
        public bool SaveGraph(string pathToPngFile)
        {
            if (String.IsNullOrEmpty(pathToPngFile))
            {
                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog
                {
                    FileName   = DataModel.Instance.GetSaveFileNamePrefix(),
                    DefaultExt = ".png",                 // Default file extension
                    Filter     = "Portable Images|*.png" // Filter files by extension
                };

                if (dlg.ShowDialog() != true)
                {
                    return(false);
                }

                pathToPngFile = dlg.FileName;
            }

            return(SavePng.SaveToPng(this.graph, this.Background, pathToPngFile));
        }