Chart.Bitmap threw an exception.
Chart.Bitmap threw an exception.
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:
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Chart.Bitmap threw an exception.
Would you please be so kind as to post here a Short, Self Contained, Correct (Compilable), Example with which we can reproduce your issue?Raavi wrote: But if I change the values very fast by pressing backspace two or more times continuously I get an exception in Chart.Bitmap.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Chart.Bitmap threw an exception.
Hello,
I am trying to reproduce the problem with spike solution but I did not find much time to do that but,
the problem is when I try to add a line series to
var seriesBandTool = new SeriesBandTool();
seriesBandTool.Series = //line series
Chart.Tools.Add(seriesBandTool);
and change the //line series really fast with change in value of a textbox.
I am trying to reproduce the problem with spike solution but I did not find much time to do that but,
the problem is when I try to add a line series to
var seriesBandTool = new SeriesBandTool();
seriesBandTool.Series = //line series
Chart.Tools.Add(seriesBandTool);
and change the //line series really fast with change in value of a textbox.
Re: Chart.Bitmap threw an exception.
StackTrace
"
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()\r\n
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.PaintChartEventHandler.Invoke(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()\r\n
at Steema.TeeChart.Styles.Series.DrawSeries()\r\n
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)\r\n
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)\r\n
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r)\r\n
at Steema.TeeChart.Chart.Metafile(Graphics gRef, Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Chart aChart, Int32 width, Int32 height)\r\n
at Steema.TeeChart.TChart.get_Metafile()"
"
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()\r\n
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.PaintChartEventHandler.Invoke(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()\r\n
at Steema.TeeChart.Styles.Series.DrawSeries()\r\n
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)\r\n
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)\r\n
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r)\r\n
at Steema.TeeChart.Chart.Metafile(Graphics gRef, Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Chart aChart, Int32 width, Int32 height)\r\n
at Steema.TeeChart.TChart.get_Metafile()"
Last edited by Raavi on Tue Mar 15, 2016 11:06 am, edited 1 time in total.
Re: Chart.Bitmap threw an exception.
Screen-shot of the exception.
- Attachments
-
- BitMapException.png (94.07 KiB) Viewed 16596 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Chart.Bitmap threw an exception.
When you say, "change the line series", what do you mean exactly? Using the following code I cannot reproduce the issue here:Raavi wrote:and change the //line series really fast with change in value of a textbox.
Code: Select all
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
Line line1;
private void InitializeChart()
{
timer.Tick += Timer_Tick;
tChart1.Aspect.View3D = false;
line1 = new Line(tChart1.Chart);
line1.FillSampleValues();
SeriesBandTool tool = new SeriesBandTool(tChart1.Chart);
tool.Series = line1;
timer.Interval = 1;
timer.Start();
}
private void Timer_Tick(object sender, EventArgs e)
{
line1.FillSampleValues();
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Chart.Bitmap threw an exception.
I am stilling try to reproduce this exception outside of my project but still no success.
Re: Chart.Bitmap threw an exception.
"
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()\r\n
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.PaintChartEventHandler.Invoke(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()\r\n
at Steema.TeeChart.Styles.Series.DrawSeries()\r\n
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)\r\n
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)\r\n
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r)\r\n
at Steema.TeeChart.Chart.Metafile(Graphics gRef, Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Chart aChart, Int32 width, Int32 height)\r\n
at Steema.TeeChart.TChart.get_Metafile()"
"
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()\r\n
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()\r\n
at Steema.TeeChart.Styles.Series.DrawSeries()\r\n
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)\r\n
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)\r\n
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g)\r\n
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height, PixelFormat pixelformat)\r\n
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height)\r\n
at Steema.TeeChart.TChart.get_Bitmap()"
These are from stack trace. I am still trying to reproduce the bug outside of my project.
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()\r\n
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.PaintChartEventHandler.Invoke(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()\r\n
at Steema.TeeChart.Styles.Series.DrawSeries()\r\n
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)\r\n
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)\r\n
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r)\r\n
at Steema.TeeChart.Chart.Metafile(Graphics gRef, Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Stream stream, Chart aChart, Int32 width, Int32 height, EmfType type)\r\n
at Steema.TeeChart.Chart.Metafile(Chart aChart, Int32 width, Int32 height)\r\n
at Steema.TeeChart.TChart.get_Metafile()"
"
at Steema.TeeChart.Tools.SeriesBandTool.DrawBandTool()\r\n
at Steema.TeeChart.Tools.SeriesBandTool.BeforeDrawValues(Object sender, Graphics3D g)\r\n
at Steema.TeeChart.Styles.Series.DoBeforeDrawValues()\r\n
at Steema.TeeChart.Styles.Series.DrawSeries()\r\n
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)\r\n
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)\r\n
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g, Rectangle r, Boolean noTools)\r\n
at Steema.TeeChart.Chart.Draw(Graphics g)\r\n
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height, PixelFormat pixelformat)\r\n
at Steema.TeeChart.Chart.Bitmap(Int32 width, Int32 height)\r\n
at Steema.TeeChart.TChart.get_Bitmap()"
These are from stack trace. I am still trying to reproduce the bug outside of my project.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Chart.Bitmap threw an exception.
Why have you got calls to get_Bitmap() and get_Metafile()? These should not be in any normal stacktrace, as they are not called unless done so specifically in user code.Raavi wrote:"
These are from stack trace. I am still trying to reproduce the bug outside of my project.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Chart.Bitmap threw an exception.
I do not call anything expect adding 'SeriesBandTool' to chart.
I hope, I can succeed in reproducing this exception in spike solution.
I hope, I can succeed in reproducing this exception in spike solution.