Common ImageAnimator methods are shown in the table.
Common Methods for table ImageAnimator classes
Method
Description
Animate
Show multiple frames as an animation
CanAnimate
Returns a Boolean value indicating whether the specified image contains a time-based frame.
Equals
Overloaded. Determine whether the two Object instances are equal (inherited from the Object)
GetHashCode
Used as a hash function of a specific type. GetHashCode is applicable to hash algorithms and data structures (such as hash tables) (inherited from objects)
GetType
Get the Type of the current instance (inherited from Object)
ReferenceEquals
Determine whether the specified Object instance is the same instance (inherited from the Object)
StopAnimate
Terminate an animation.
ToString
Returns the String of the current Object (inherited from the Object)
UpdateFrames
This method can be used to update time frames.
The following describes the common methods of the ImageAnimator class.
Animate Method
Syntax
Public static void Animate (
Image image,
EventHandler onFrameChangedHandler
)
Parameters
Image: The Image object to be animated.
OnFrameChangedHandler: An EventHandler object that specifies the method called when the animation frame changes.
Return Value: This method has no return value.
CanAnimate Method
Syntax
Public static bool CanAnimate (
Image image
)
Parameters
Image: The Image object to be tested.
Return Value: if the specified image contains a time-based frame, true is returned for this method; otherwise, false is returned.
StopAnimate Method
Syntax
Public static void StopAnimate (
Image image,
EventHandler onFrameChangedHandler
)
Parameters
Image: The Image object to stop animation processing.
OnFrameChangedHandler: An EventHandler object that specifies the method called when the animation frame changes.
Return Value: This method has no return value.
UpdateFrames Method
Move the frame forward to all images currently being animated. The new frame is drawn when the next image is rendered.
Syntax
Public static void UpdateFrames ()
Return Value: This method has no return value.
UpdateFrames method (Image)
Move the frame forward in the specified image. The new frame is drawn when the next image is rendered. This method is only applicable to images that contain time-based frames.
Syntax
Public static void UpdateFrames (
Image image
)
Parameters
Image: The Image object for which the frame is to be updated.
Return Value: This method has no return value.
Note: AVI files played with the AutoPlay attribute will be repeated until the value is set to False.