Board index » delphi » Emergency : GDI : My draws disappear

Emergency : GDI : My draws disappear

I use GDI to draw on the screen with canvas.method.

My problem : Everything work, it is very nice but ...
... when I switch to another program with Alt-Tab and I
come back to my application I don't have my draw
anymore. I should have to repaint it but when does I have to
program this procedure, on which events ?

Please help me, because everything is ready except this error.

Thanks a lots.

Answer : E-Mail : xavier.vanvlassel...@ping.be

 

Re:Emergency : GDI : My draws disappear


In article <4ldasb$...@news1.Belgium.EU.net>,
xavier.vanvlassel...@ping.be says...

Quote

>I use GDI to draw on the screen with canvas.method.
>Please help me, because everything is ready except this error.

Man that is bad. You should not let your drawers disappear.
Sorry. I can not help.

Lafter.

Re:Emergency : GDI : My draws disappear


In article <4ldasb$...@news1.Belgium.EU.net>,
   xavier.vanvlassel...@ping.be (Xavier Van Vlasselaer) wrote:
]-I use GDI to draw on the screen with canvas.method.
]-
]-My problem : Everything work, it is very nice but ...
]-..... when I switch to another program with Alt-Tab and I
]-come back to my application I don't have my draw
]-anymore. I should have to repaint it but when does I have to
]-program this procedure, on which events ?

Try using the OnPaint event of your form.  The OnPaint
help topic includes some example code that shows how
you might go about this.

]-
]-
]-Please help me, because everything is ready except this error.
]-
]-Thanks a lots.
]-
]-Answer : E-Mail : xavier.vanvlassel...@ping.be
]-
]-

Re:Emergency : GDI : My draws disappear


xavier.vanvlassel...@ping.be (Xavier Van Vlasselaer) wrote:

Quote
>I use GDI to draw on the screen with canvas.method.
>My problem : Everything work, it is very nice but ...
>... when I switch to another program with Alt-Tab and I
>come back to my application I don't have my draw
>anymore. I should have to repaint it but when does I have to
>program this procedure, on which events ?

Hi,
You have to "remeber" or keep a record of everything that has been
drawn on the canvas and then respond to the OnPaint event or WM_PAINT
messages. During this message everything should be re-drawn. It is the
indication from Windows that part of your canvas has been covered and
needs to be refreshed.

You can find examples of handling OnPaint events in the "Paint
Program" demos that are usually included with Delphi books.

Hope this helps.

Barry.

/---------------------------------------------------------------\
| Check out CanalRun's WWW page http://www.vcomm.net/~canalrun/ |
| Education, Investment, Personal Productivity Shareware.       |
\---------------------------------------------------------------/

Other Threads