Page 1 of 1

How To implement InvalidateRect

Posted: Fri Jan 28, 2005 1:48 am
by 9338026
I have a strange problem. (Delphi 7)

I have an mdichild with a single form on it. The form contains a tchart with align=alClient.

I am doing some drawing on the tchart in the onAfterDraw event. If I do chart.invalidate, the drawing works perfectly.

However, if I do this
var
tst:tRect
begin

tst:=chart1.boundsRect;
invalidaterect(chart1.handle,@tst,false)
end;

nothing happens. invalidateRect is a windows API command that allows you to invalidate only certain portions of a window. Since I chose the whole boundsRect, it should repaint the whole window. but it doesn't.

Of course, eventually, I only want to repaint small parts of the window, but can you tell me how to properly use invalidateRect with Tchart.

Posted: Fri Feb 11, 2005 1:09 pm
by Pep
Hi David,

it does not work with TChart component if it's double-buffered. To make it work you have to set the BufferedDisplay property to false :

Chart1.BufferedDisplay:=False;

Posted: Wed Feb 23, 2005 8:24 pm
by 9338026
Thank you pep, I will give that a try