I want to take screenshots of my chart and save it to my drive when certain conditions are met.
I use the below code (which is taken from SendMailChart on this site), but it only works on new bars, the image is blank on historical data.
Any ideas, how i can get a screenshot for historical data as well?
Thanks a lot!
private void SaveScreenShot(ChartControl chart){ // get bitmap of chart panel System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(chart.ChartPanel.Width, chart.ChartPanel.Height, PixelFormat.Format16bppRgb555); chart.ChartPanel.DrawToBitmap(bmp, chart.ChartPanel.ClientRectangle); bmp.Save(imageDirectory + fileName, ImageFormat.Png); }
Comment