Page 1 of 1

Multiple repaint/refresh issues (draw to memory?)

Posted: Thu Nov 22, 2007 3:55 am
by 5887294
Is it possible for TChart to paint/draw to memory rather than to screen to avoid flashing with multiple repaints/refresh, and then explicitly request the chart to draw to canvas?

Im using the Series::CalcXPos() method to determine pixel positions to display a TColorBandTool. I need to update the start and end values of the colorband on chart zoom events. The problem is that the CalcXPos seems to require the chart repaint to have been executed before i can get the latest values after a zoom event. Then i adjust the colorbandtool start and end values, and finally force another repaint which causes flashing (since its redrawn).

Posted: Thu Nov 22, 2007 10:25 am
by narcis
Hi Marcus,

You can force TeeChart being internally repainted making a call to Draw method, for examle: Chart1.Draw;. If you don't want TeeChart to repaint automatically you can set AutoRepaint property to false before beginning all drawing process and when finished setting it back to true and refresh the chart, something like what's shown here.

Hope this helps!