Animation Control

Volte

Neutiquam Erro
Joined
Nov 17, 2002
Messages
2,165
User Rank
*Expert*
Included with the Windows Common Controls package is an Animation control; it plays AVI animations (its not a real AVI player) such as the "file moving" and "file deleting" animations that are included with Visual Studio in the <VS Dir>/Common7/Graphics/Videos directory.

VB6s Common Controls package had this control wrapped so you could use it in VB; .NET does not.
Thats why I wrote this control. Its a basic wrapper for the animation control for .NET, written in C#.

The code is commented, so it shouldnt be that hard to figure out. To use it simply set the Filename property to the AVI animation (no sound can be in the file) you wish to play, and set the AutoPlay property to the desired value; True means it will start playing on load (or, if you set the Filename in code, as soon as you do so). You can control the number of iterations and the portion of the animation to play further by starting the file manually with the Play method:

Play #1 (int repeat, int from, int to)
This function will repeat a certain portion of the animation a specified number of times.
repeat - the number of times to repeat the animation. -1 means repeat forever.
from - the frame you wish to start playing from. 0 means start from the beginning.
to - the frame you wish to play to. -1 means play to the end.

Play #2 (int repeat)
This function will play the whole animation a certain number of times.
repeat - the number of times to repeat the animation. -1 means repeat forever.

Play #3 (int from, int to)
This function will play a certain portion of the animation forever.
from - the frame you wish to start playing from. 0 means start from the beginning.
to - the frame you wish to play to. -1 means play to the end.

Play #4 ()
This function will play the whole animation forever.

Please direct all comments and bugs to me in private message.


[edit]Fixed an error that has been bothering me for awhile[/edit]
 

Attachments

Last edited by a moderator:
Back
Top