Animation Sample

To get samples and instructions for installing them, see the following:

  • Click Samples on the Visual Studio Help menu.

    For more information, see Locating Sample Files.

  • The most recent versions and the complete list of samples are available on the Visual Studio 2008 Samples Web site.

  • You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied to a folder under \Program Files\Visual Studio 9\Samples\. For Visual Studio Express Editions, all samples are located on the Internet.

To run this sample

  • Press F5.

Demonstrates

This sample uses a Timer object to control the animation changes and RadioButton controls to select the animation object. Three animation styles are shown:

  • Frame animation. The winking eye is implemented as a series of static images (frames). With each timer tick, the next frame is displayed.

  • Flying objects. The size and speed of the bouncing ball are relative to the client area. This animation is implemented by drawing to the Graphics object of the form.

  • Text animation. Text is drawn using the LinearGradientBrush object. A different brush is created at each timer tick by changing the parameters to the LinearGradientBrush. The parameters move the gradient-fill start and end points.