is there a way to get a chart screenshot from code?
I've tried the following with ChartPanel.PanelsAreaRectangle but only get a black rectangle. The code is first called like this:
// have to invoke on the thread that owns the chart panel, otherwise THIS thread has no access
ChartPanel.Dispatcher.Invoke(new System.Action(() => GetScreenShot(...);
private void GetScreenShot(...)
{
System.Windows.Media.Imaging.RenderTargetBitmap renderTargetBitmap = new System.Windows.Media.Imaging.RenderTargetBitmap(ChartPanel.W, ChartPanel.H, (double)RenderTarget.DotsPerInch.Width, (double)RenderTarget.DotsPerInch.Height, PixelFormats.Default);
renderTargetBitmap.Render(ChartControl.PanelsAreaRectangle);
// etc
saltminer

Comment