/// <summary> /// Export the graph to the clipboard /// </summary> public void ExportToClipboard() { MemoryStream stream = new MemoryStream(); PngExporter pngExporter = new PngExporter(); pngExporter.Width = 800; pngExporter.Height = 600; pngExporter.Export(plot1.Model, stream); Clipboard cb = MainWidget.GetClipboard(Gdk.Selection.Clipboard); cb.Image = new Gdk.Pixbuf(stream); }
/// <summary> /// Export the graph to the specified 'bitmap' /// </summary> /// <param name="bitmap">Bitmap to write to</param> /// <param name="legendOutside">Put legend outside of graph?</param> public void Export(ref Bitmap bitmap, bool legendOutside) { MemoryStream stream = new MemoryStream(); PngExporter pngExporter = new PngExporter(); pngExporter.Width = bitmap.Width; pngExporter.Height = bitmap.Height; pngExporter.Export(plot1.Model, stream); bitmap = new Bitmap(stream); }