Error processing SSI file
(Leadtools.Controls)

Show in webframe

FrameChanged Event




Occurs when the frame changes during animation playback.
Syntax
Event Data

The event handler receives an argument of type RasterPictureBoxFrameChangedEventArgs containing data related to this event. The following RasterPictureBoxFrameChangedEventArgs properties provide information specific to this event.

PropertyDescription
Index An integer which represents the index of the currently displayed frame.
Remarks
This event is raised if the AnimationMode property is changed by either a programmatic modification or user interaction.
Example

This example uses the FrameChanged event to show how the AnimationMode has changed.

Copy Code  
Imports Leadtools
Imports Leadtools.Controls
Imports Leadtools.Codecs
Imports Leadtools.Drawing

Private Sub viewer_PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs)
   If e.PropertyName = "AnimationMode" Then
      Dim viewer As RasterPictureBox = TryCast(sender, RasterPictureBox)
      Dim s As String = String.Format("AnimationModeChanged Event: {0}", viewer.AnimationMode.ToString())
      MessageBox.Show(s)
   End If
End Sub
<TestMethod>
Public Sub RasterPictureBox_AnimationModeChanged_Runner()
   RasterPictureBox_AutoDisposeImage(New RasterPictureBox())
End Sub
Public Sub RasterPictureBox_AnimationModeChanged(ByVal viewer As RasterPictureBox)
   AddHandler viewer.PropertyChanged, AddressOf viewer_PropertyChanged

   Select Case viewer.AnimationMode
      Case RasterPictureBoxAnimationMode.Infinite
         viewer.AnimationMode = RasterPictureBoxAnimationMode.UseImageGlobalLoop

      Case RasterPictureBoxAnimationMode.UseImageGlobalLoop
         viewer.AnimationMode = RasterPictureBoxAnimationMode.Infinite
   End Select

   viewer.PlayAnimation()
   RemoveHandler viewer.PropertyChanged, AddressOf viewer_PropertyChanged
End Sub
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;

public void RasterPictureBox_AnimationModeChanged()
{
   RasterPictureBox viewer = new RasterPictureBox();
   viewer.PropertyChanged += viewer_PropertyChanged;
   switch (viewer.AnimationMode)
   {
      case RasterPictureBoxAnimationMode.Infinite:
         viewer.AnimationMode = RasterPictureBoxAnimationMode.UseImageGlobalLoop;
         break;

      case RasterPictureBoxAnimationMode.UseImageGlobalLoop:
         viewer.AnimationMode = RasterPictureBoxAnimationMode.Infinite;
         break;
   }

   viewer.PlayAnimation();
   viewer.PropertyChanged -= viewer_PropertyChanged;
}

private void viewer_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
   if (e.PropertyName == "AnimationMode")
   {
      RasterPictureBox viewer = sender as RasterPictureBox;
      string s = string.Format("AnimationModeChanged Event: {0}", viewer.AnimationMode.ToString());
      MessageBox.Show(s);
   }
}
Requirements

Target Platforms

See Also

Reference

RasterPictureBox Class
RasterPictureBox Members

Error processing SSI file