示例#1
0
        private void screenshotButton_Click(object sender, EventArgs e)
        {
            Bitmap         bitmap         = ImageExporter.FromBundle(new Bundle(this.graphVisualizationInfoView.Controller.Model.Paintables), this.graphVisualizationInfoView.Controller.View.Graphics);
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Title        = "Save Screenshot";
            saveFileDialog.DefaultExt   = "png";
            saveFileDialog.Filter       = "Portable Network Graphics|*.png|All Files|*.*";
            saveFileDialog.FilterIndex  = 1;
            saveFileDialog.AddExtension = true;

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                bitmap.Save(saveFileDialog.FileName);
            }
        }