Hi,
Firstly I wanted to mention that the latest update with the double buffering update is excellent. It’s nice and fast after it’s created the chart, no more sluggish windows.
We have one minor problem as a side effect though which I’m hoping you can help with. We override the OnPaint handler to write custom header and footer information and provide some hot-tracking in a Windows Forms application. What we’re finding is that the header and footer information doesn’t always get redrawn properly when windows are dragged over the top. The underlying chart is fine but if we drag a form over the top quickly, sometimes we only see part of the custom text.
We could probably get rid of most of the existing header and footer code and re-write it to use the chart annotation method but if there’s a simple way around it to accommodate the new changes, we’d prefer to do it that way.
It would be good to know in case there are other occasions we need to override the OnPaint handler.
Custom OnPaint additions with new release
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Loz,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance!
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance!
Best Regards,
Narcís Calvet / 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 |
I've posted an example...
The project file is called: ChartOnPaint.rar
The OnPaint handler is in DerivedControls.cs
The function that writes the custom text is DrawHeaderAndFooterText.
We're also doing a few other custom bits and pieces but I've tried to create a basic stripped down example that demonstrates the issue.
To replicate the problem, quickly drag another window over the application when it's running. e.g. Explorer or anything else you have open and you'll see that the thumbnail is painted from what I assume to be the internally cached buffer which doesn't include the added text.
Thanks.
The project file is called: ChartOnPaint.rar
The OnPaint handler is in DerivedControls.cs
The function that writes the custom text is DrawHeaderAndFooterText.
We're also doing a few other custom bits and pieces but I've tried to create a basic stripped down example that demonstrates the issue.
To replicate the problem, quickly drag another window over the application when it's running. e.g. Explorer or anything else you have open and you'll see that the thumbnail is painted from what I assume to be the internally cached buffer which doesn't include the added text.
Thanks.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Loz,
Thanks for the example project. You can achieve what you request changing your OnPaint override for this:
Thanks for the example project. You can achieve what you request changing your OnPaint override for this:
Code: Select all
private BufferedGraphics bGraphics;
private Steema.TeeChart.IChart parent;
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
parent = Chart.Parent;
bGraphics = parent.GetBackBuffer();
DrawHeaderAndFooterText(bGraphics.Graphics);
bGraphics.Render();
}
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Loz,
You're very welcome! We are glad to hear that helped.
You're very welcome! We are glad to hear that helped.
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello Loz,
Please be aware that in future releases, the code below will not compile:
The code has been refactored somewhat meaning that the BufferedGraphics class will be available directly from the TeeChart Graphics3D class. The following code will therefore replace the above:
Please be aware that in future releases, the code below will not compile:
Code: Select all
private BufferedGraphics bGraphics;
private Steema.TeeChart.IChart parent;
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
parent = Chart.Parent;
bGraphics = parent.GetBackBuffer();
DrawHeaderAndFooterText(bGraphics.Graphics);
bGraphics.Render();
}
Code: Select all
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
DrawHeaderAndFooterText(Chart.Graphics3D.BackBuffer.Graphics);
Chart.Graphics3D.BackBuffer.Render();
}
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/