Refresh Problem?

leazfe

New member
Joined
Apr 20, 2004
Messages
4
Location
Sevilla, Espa
I have the follow problem: The first time i draw the image I get a blank screen( The image stay only a half second) but the next time the image is good drawn. I have looked for a refresh method but i didn
 
This happens as when the form is asked to redraw its self - it calls its OnPaint method (which i am assuming you have not handeled) - therefore it is cleared.

What you need to do is capture the Paint event of the control you are drawing the imagine onto - and draw your image onto e.Graphics (where e is the event object captured in the event - youll see). Everything Invalidate is called (you can do this manually via Control.Invalidate()) the Paint event is called where your code to plot the image should reside.

Hope this helps
 
Back
Top