Reputation: 11137
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
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
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