Make silly eyes that track the mouse without flicker in C#

[track the mouse]

The example Make silly eyes that track the mouse in C# shows how to make eyes track the mouse position, but if you look closely as that program runs you will see a noticeable flicker.

The solution is quite simple: set the form’s DoubleBuffered property to true. Rather than drawing everything on the screen as it is generated, this property makes the form first draw onto an image in memory and then display the result only when the image is complete. The result is flicker-free.

For another example that uses double buffering, see Use double buffering to prevent flicker in a PictureBox in C#.


Download Example   Follow me on Twitter   RSS feed   Donate




This entry was posted in games, geometry, graphics and tagged , , , , , , , , , , , , . Bookmark the permalink.

One Response to Make silly eyes that track the mouse without flicker in C#

  1. Oh, how I wish we should learn C# in school and not C++..

Leave a Reply

Your email address will not be published. Required fields are marked *