Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all articles
Browse latest Browse all 2061

New Post: How to copy a plot in WindowsForms ?

$
0
0
Here's how I'm handling it:
PlotController.BindKeyDown(OxyKey.C,
                           OxyModifierKeys.Control,
                           new DelegatePlotCommand<OxyKeyEventArgs>(
                               CopyChart_OnKeyDown));
                               
privatevoid CopyChart_OnKeyDown(
    IPlotView view,
    IController controller,
    OxyKeyEventArgs args)
{
    var chartBitmap = new Bitmap(uiPlotView.Width, uiPlotView.Height);
    uiPlotView.DrawToBitmap(chartBitmap,
                            new Rectangle(0, 0, uiPlotView.Width, uiPlotView.Height));
    Clipboard.SetImage(chartBitmap);
}
I actually based this on some code that used to be in the PlotCommands, not sure why it was taken out.

Viewing all articles
Browse latest Browse all 2061

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>