I have read several threads on this and I am still not sure what a good approach is.
We have an MDI application that has mdi children containing charts. If the child form his hidden then shown we receive an ArgumentException when it hits the line "Chart.Graphics3D.BackBuffer.Render();" in the OnPaint of TeeChart.cs.
One solution that was pitched by Narcis was to set Graphics3D.UseBuffer to false, i.e. this.tChart1.Graphics3D.UseBuffer = false;
This certainly prevents the error but now the repainting looks bad when another window is passed over the chart. I read some other thread talking about DoubleBufferring but kind of got lost in the replies.
Is there a good solution to my problem, preventing the error and having a clean repaint?
Thanks,
Kevin
ArgumentException when Hiding.Showing MDI child form
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Re: ArgumentException when Hiding.Showing MDI child form
Hello,
http://www.teechart.net/support/viewtopic.php?t=6631
As you can read here, the primary motivation for its inclusion into TChart was to prevent sluggish repainting when one window was moved over another. However, at that stage the MDI problems hadn't come into the fore. Now that they are here, the only solution at present is to do what Narcís suggests.
We are very willing to look into this problem and find a more satisfactory solution to it. If you would be so kind as to write for us a little app we can run "as-is" to reproduce your issue, we will study it and get back to you with more options. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
The history of the implementation of manual double-buffering can be found in this thread:WD_Gordon wrote:This certainly prevents the error but now the repainting looks bad when another window is passed over the chart. I read some other thread talking about DoubleBufferring but kind of got lost in the replies.
Is there a good solution to my problem, preventing the error and having a clean repaint?
http://www.teechart.net/support/viewtopic.php?t=6631
As you can read here, the primary motivation for its inclusion into TChart was to prevent sluggish repainting when one window was moved over another. However, at that stage the MDI problems hadn't come into the fore. Now that they are here, the only solution at present is to do what Narcís suggests.
We are very willing to look into this problem and find a more satisfactory solution to it. If you would be so kind as to write for us a little app we can run "as-is" to reproduce your issue, we will study it and get back to you with more options. You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Another suggestion that I saw was to set the tChart1.Chart.Graphics3D.BackBuffer to null when the object is hidden or shown, i.e. tChart1.Chart.Graphics3D.BackBuffer = null. This seems to work and paints much cleaner than setting this.tChart1.Graphics3D.UseBuffer to false.
Are there any downsides to setting the BackBuffer to null?
Are there any downsides to setting the BackBuffer to null?
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
Not at all. In fact, this is exactly what TChart's override of OnResize does:WD_Gordon wrote:Are there any downsides to setting the BackBuffer to null?
Code: Select all
protected override void OnResize(EventArgs e)
{
if (Chart.Graphics3D.BackBuffer != null)
{
Chart.Graphics3D.BackBuffer.Dispose();
Chart.Graphics3D.BackBuffer = null;
}
base.OnResize(e);
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/