Class: cAnimation
Properties | Events | Methods | Index of Classes
Displays an AVI animation clip
Hierarchy
cObject > cUIObject > DfBaseObject > DfBaseWindow > DfBaseUIWindow > DfBaseControl > cWinControl > cAnimation
Show full hierarchy and direct subclasses
Library: Windows Application Class Library
Package: cAnimation.pkg
Description
The cAnimation control displays an AVI animation clip. An AVI clip is a series of bitmap frames like a movie. cAnimation controls can only display AVI clips that do not contain audio.
One common use for an animation control is to indicate system activity during a lengthy operation. This is possible because the operation thread continues executing while the AVI clip is displayed. For example, the Find dialog box of Windows' Explorer displays a moving magnifying glass as the system searches for a file.
An animation control can display an AVI clip originating from either an uncompressed AVI file or from an AVI file that was compressed using run-length (BI_RLE8) encoding.
| Col 1 | Col 2 |
|---|---|
| Note: | The AVI file must not have a sound channel. The capabilities of the animation control are very limited and are subject to change by Microsoft. |
Usage
Several animation files are provided and you can access these with the peAnimation property. To use other AVI files, use the psFileName property. Use the pbActive property to play and stop the animation.
Use the pbTransparent property to play the animation clip with a transparent background, and the pbAutoSize property to automatically size the control to the size of the frames of the animation clip. You can control the number of repetitions that the animation plays with the piRepetitions property.
You can also use the DoOpen and DoClose methods to open and close an animation file. The DoPlay and DoStop methods to play and stop the animation.
When an animation clip starts to pay, the OnStart event is sent. When the clip finishes playing, the OnStop event is sent.
The pbIsOpen property is used to determine if an animation file was opened successfully.
Sample
Object oDeleteFiles is a cAnimation
Set Location To 5 5
Set pbTransparent To True // play "transparently"
Set pbAutoSize To True // size the control from the AVI
Set piRepetitions To 0 // repeat indefinitely
Procedure DoDeleteFiles
Set peAnimation To aviFileDelete // copy \Bitmap\FileDel.AVI file to workspace
Set pbActive To True // open and start playing
// ToDo: add code to delete records here...
// The Info_Box will keep the AVI on screen long enough to see it in our sample
Send Info_Box "Click 'OK' button to continue"
Set pbActive To False // stop playing
Set peAnimation To aviNone // close the animation
End_Procedure
End_Object
Object oDelete_bn is a Button
Set Location to 100 120
Set Label to "Delete Selected Files"
Procedure onClick
Send DoDeleteFiles of oDeleteFiles
End_Procedure
End_Object
See Also