Flickering while refreshing

J

Jack Smash

Hi,

I'm using a UserControl object for all the graphics handling in my
application. However, if I select an image and move it around, I get
flickering. So in order to get rid of the flickering, I added this code in
the constructor of the UserControl:

this.SetStyle(ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true);

Now the control doesn't flicker, but I still get some minor flickering of
the image I am moving, and if I move the mouse too quickly, the image will
not "keep up" with the mouse pointer.

Any suggestions?
 
A

Allen Anderson

how exactly are you moving that image around? If you are doing all
your painting to the Graphics object that comes through onpaint then
if your using doublebuffer and all painitng in paint you shouldn't get
any flicker at all. Are you instead using a second control and
painting on that perhaps?

Also, are you overriding OnPaintBackground?

Allen Anderson
http://www.glacialcomponents.com
mailto: allen@put my website url here.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top