Chart.Bitmap threw an exception.
Posted: Thu Mar 03, 2016 11:39 am
I try to draw when ever there is change in the value of the textbox in C# application.
E.g., diameter=8.323232
If I change the above value slowly like 8.32323, 8.3232 and so on by pressing backspace I have no problems the charts renders the change in the value.
But if I change the values very fast by pressing backspace two or more times continuously I get an exception in Chart.Bitmap.
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=TeeChart
StackTrace:
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)
at Steema.TeeChart.PaintChartEventHandler.Invoke(Object sender, Graphics3D g)
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)
at Steema.TeeChart.Chart.Draw(Graphics g)
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height, PixelFormat pixelformat)
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height)
at Steema.TeeChart.TChart.get_Bitmap()
at *some namespace*.AddChartView() in ..\Control.cs:line 805 *This line is edited by me*
at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.WmReflectCommand(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:
E.g., diameter=8.323232
If I change the above value slowly like 8.32323, 8.3232 and so on by pressing backspace I have no problems the charts renders the change in the value.
But if I change the values very fast by pressing backspace two or more times continuously I get an exception in Chart.Bitmap.
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=TeeChart
StackTrace:
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)
at Steema.TeeChart.PaintChartEventHandler.Invoke(Object sender, Graphics3D g)
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)
at Steema.TeeChart.Chart.Draw(Graphics g)
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height, PixelFormat pixelformat)
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height)
at Steema.TeeChart.TChart.get_Bitmap()
at *some namespace*.AddChartView() in ..\Control.cs:line 805 *This line is edited by me*
at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.WmReflectCommand(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException: