LEADTOOLS Windows Forms (Leadtools.WinForms assembly)
LEAD Technologies, Inc

FrameChanged Event

Example 





Occurs when the frame changes during animation playback.
Syntax
'Declaration
 
Public Event FrameChanged As EventHandler(Of RasterPictureBoxFrameChangedEventArgs)
'Usage
 
Dim instance As RasterPictureBox
Dim handler As EventHandler(Of RasterPictureBoxFrameChangedEventArgs)
 
AddHandler instance.FrameChanged, handler
add_FrameChanged(function(sender, e))
remove_FrameChanged(function(sender, e))

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
 
Private Sub viewer_AnimationModeChanged(ByVal sender As Object, ByVal e As EventArgs)
    Dim viewer As RasterPictureBox = CType(IIf(TypeOf sender Is RasterPictureBox, sender, Nothing), RasterPictureBox)
    Dim s As String = String.Format("AnimationModeChanged Event: {0}", viewer.AnimationMode.ToString())
    MessageBox.Show(s)
End Sub
Public Sub RasterPictureBox_AnimationModeChanged(ByVal viewer As RasterPictureBox)
    AddHandler viewer.AnimationModeChanged, AddressOf viewer_AnimationModeChanged

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

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

    viewer.PlayAnimation()
    RemoveHandler viewer.AnimationModeChanged, AddressOf viewer_AnimationModeChanged
End Sub
private void viewer_AnimationModeChanged(object sender, EventArgs e)
{
   RasterPictureBox viewer = sender as RasterPictureBox;
   string s = string.Format("AnimationModeChanged Event: {0}", viewer.AnimationMode.ToString());
   MessageBox.Show(s);
}
public void RasterPictureBox_AnimationModeChanged(RasterPictureBox viewer)
{
   viewer.AnimationModeChanged += new EventHandler(viewer_AnimationModeChanged);

   switch (viewer.AnimationMode)
   {
      case RasterPictureBoxAnimationMode.Infinite:
         viewer.AnimationMode = RasterPictureBoxAnimationMode.UseImageGlobalLoop;
         break;

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

   viewer.PlayAnimation();
   viewer.AnimationModeChanged-= new EventHandler(viewer_AnimationModeChanged);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RasterPictureBox Class
RasterPictureBox Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.