when a form receives a paint event it actually erases itself then calls ur paint event. this is why u get the flicker. using the backgroundimage property doesn't erase the form -> no more flicker.
 
what u want to do is to call pictureForm.SetStyle(UserPaint|AllPaintingInWmPaint, True); in ur constructor so that the form doesn't erase itself. then override the OnPaint virtual method and do ur drawing there.
 
----------------------------------
Peace and love,
Tweety
[EMAIL PROTECTED] - [EMAIL PROTECTED]
YahooID: tweety_04_01


From: Ben Watson [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 11, 2004 7:38 PM
To: [EMAIL PROTECTED]
Subject: [Microsofts_C_Sharp] flicker free refreshing

Hi, this is the first time I’ve written to the list, but I have something I can’t figure out how to resolve.

 

Basically, I have a form that paints an image into the entire client area. The image is updated continually, so I I’m calling pictureForm.Refresh() a lot.

 

I’ve tried two different methods. In one, I override the Paint method and draw the bitmap using DrawImage(). This lets me scale the image to the window size. It’s with this method I get the flickering.

 

The second method I’ve tried is to use the BackgroundImage property of a Form. This doesn’t let me resize the image to fit the window, but there is no flicker when I refresh.

 

Can anyone tell me what’s going on? How does BackgroundImage work that it can paint with no flicker. How can I get my Paint function to draw the image flicker-free?

 

Thanks for any help you might offer,

Ben Watson



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to