Alex
Alex

Reputation: 11137

c# winform drawn image flashing

I have a image drawn in an winform app and i designed a brush that moves after the cursor. The Brush is drawn every time so the image keeps flashing because the image is also redrawn . How can i avoid this ?

Regards, Alex Badescu

Upvotes: 2

Views: 1243

Answers (2)

Øyvind Bråthen
Øyvind Bråthen

Reputation: 60694

Simply set the form's DoubleBuffered property to true. That should solve the flickering.

No reason to make it more advanced than this, in such a simple scenario.

Upvotes: 1

Grozz
Grozz

Reputation: 8425

Use double-buffering. Draw each frame to some kind of memory bitmap representing the back buffer and once it's drawn show it on the first.

For more info read here: http://msdn.microsoft.com/en-us/library/b367a457.aspx

Upvotes: 3

Related Questions