Share via


Animation Class

Methods | This Package | All Packages

Encapsulates a Windows animation control, a rectangular control that plays an Audio-Video Interleaved (AVI) animation file.

Component
  |
  +--Control
    |
    +--Animation

package com.ms.wfc.ui

public class Animation
extends
Control****

Remarks

To specify which animation file to play in an Animation control, use the setFileName method. Use the start method to start the animation, and use the stop method to end it. Use the setAutoPlay method to set the autoPlay property to true if you want the animation to begin automatically when the Animation control loads the animation file. The Animation control can play only uncompressed AVI files or AVI files that have been compressed using Run-Length Encoding (RLE). If sound information is included in the AVI file, the Animation control ignores it. One common use for an Animation control is to indicate system activity during a lengthy operation. For example, the Find dialog box in Windows Explorer displays a moving magnifying glass as the system searches for a file.

The following example plays the animation file Clock.avi three times from frame four to the end:

private void btnAnimate_click(Object source, Event e)
{
    animation1.setFileName("D:\\WINNT\\clock.avi"); //sets the file to play
    animation1.start(3,4,-1); //plays from frame 4 to the end of the movie 3 times
}