TChart transparency bug
Posted: Wed Oct 27, 2010 4:10 pm
I think there is a pretty obvious bug in TChart, but of course, I may well be wrong!
Anyway, if you just create a chart, display it on a form, set Align to alClient and then make it transparent (Chart.Color := clNone). Then when you resize the form the chart fails to repaint correctly. The problem is that the background doesn't get redrawn at all (TCustomTeePanelExtended.PaintBack) and this is all compounded by the including of WS_EX_TRANSPARENT in Params.ExStyle in TCustomTeePanel.CreateParams.
What I found was that it seemed better to comment out the WS_EX_TRANSPARENT code and then include some extra code in TCustomTeePanelExtended.PaintBack to call ThemeServices.DrawParentBackground if the window is transparent.
I'd appreciate it if one of the developers could look into this and at the very least confirm that my hack is a reasonable solution.
Anyway, if you just create a chart, display it on a form, set Align to alClient and then make it transparent (Chart.Color := clNone). Then when you resize the form the chart fails to repaint correctly. The problem is that the background doesn't get redrawn at all (TCustomTeePanelExtended.PaintBack) and this is all compounded by the including of WS_EX_TRANSPARENT in Params.ExStyle in TCustomTeePanel.CreateParams.
What I found was that it seemed better to comment out the WS_EX_TRANSPARENT code and then include some extra code in TCustomTeePanelExtended.PaintBack to call ThemeServices.DrawParentBackground if the window is transparent.
I'd appreciate it if one of the developers could look into this and at the very least confirm that my hack is a reasonable solution.