How To implement InvalidateRect

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
David Novo
Newbie
Newbie
Posts: 71
Joined: Fri Jul 02, 2004 4:00 am
Location: Culver City
Contact:

How To implement InvalidateRect

Post by David Novo » Fri Jan 28, 2005 1:48 am

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.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Feb 11, 2005 1:09 pm

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;

David Novo
Newbie
Newbie
Posts: 71
Joined: Fri Jul 02, 2004 4:00 am
Location: Culver City
Contact:

Post by David Novo » Wed Feb 23, 2005 8:24 pm

Thank you pep, I will give that a try

Post Reply