Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redraw Problem ( OnPaint EH ) 1

Status
Not open for further replies.

TelemLab

Technical User
Mar 22, 2008
3
US
I'm having a redraw problem with a Logic Analyzer program
I am writing. All data is written to a hidden TImage
and using the FormPaint EH to display the data
with
CopyRect(MyRect,Image1->Canvas,Image1->BoundsRect);
Unfortunately, any other program opened and moved over the
display area acts like a giant eraser. Is there a better
method or one that I am not aware of?
Thanks in Advance.
--LightSpeed
 
Try judiciously adding "Application->ProcessMessages();" to your program. Maybe on the form's OnFocus event or somewhere near the drawing routine.

Note that if you add the line to where it will be constantly be run will slow down your program but the screen WILL redraw. You may have to "play" with it a bit.


James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
Thanks James. I will give this a try and see if it helps
redrawing the data. I thought the FormPaint ( or OnPaint )
EH would have taken care of it, but I guess not.
Regards-LS
 
As far as I can tell, the redrawing won't work unless the app is allowed to process messages from Windows. One of which must tell the app that the screen needs to be redrawn. It took me a while to figure that one out.


James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
OK James, all seems to be working now. Along with the
Proc->Msg(); I made the TImage visible, took the CopyRect()
out of the Formpaint EH.
I remember a long time ago, in one of the CBuilder books,
there was a stopwatch or clock program using the method
I tried. It worked well but my version,apparently,
didn't ... Har !

( No .... Double Har ! )

Thanks again. --LightSpeed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top