Title: Make silly eyes that track the mouse without flicker in C#
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.
Download the example to experiment with it and to see additional details.
|