|
Background Image Efficiency |
Posted by David Salonius on Jan-30-2013 23:55 |
|
Hi Peter,
I'm coming from using ASP.NET and the WebChartViewer control where building a transparent background chart is easy. Moving to Windows forms now, creating a transparent chart viewer to let a background show through is a challenge. So I decided to try putting a background image within the chart itself. The problem I've run in to is the chart draw time is now taking about 700 ms with the background image. If I remove it, it drops down to ~30 ms.
The background image I'm using is 2560x1600 and chart director seems to crop it to what's in view. I am using a large image because the chart has the potential to be sized to full screen and that resolution is a possibility.
Regardless, any ideas on how I can accomplish putting a background behind my chart in a more efficient manner? If you have any ideas on how it could work with a transparent background, that would be my preferred route.
Thanks! |
Re: Background Image Efficiency |
Posted by Peter Kwan on Jan-31-2013 22:53 |
|
Hi David,
If your intention is to make the chart background transparent, you may try the following method (in C#):
//output chart as usual
viewer.Chart = c;
//make the background color in the chart transparent (assume the background color is white)
((System.Drawing.Bitmap)viewer.Image).MakeTransparent(System.Drawing.Color.White);
//the control itself must be transparent too
viewer.BackColor = System.Drawing.Color.Transparent;
Hope this can help.
Regards
Peter Kwan |
|