←Select platform

FrameChanged Event

Summary

Occurs when the frame changes during animation playback.

Syntax

C#
VB
C++
public event EventHandler<RasterPictureBoxFrameChangedEventArgs> FrameChanged 
  
Public Event FrameChanged As EventHandler(Of RasterPictureBoxFrameChangedEventArgs) 
public: 
event EventHandler<RasterPictureBoxFrameChangedEventArgs^>^ FrameChanged 

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 AnimationModeChanged event to show how the AnimationMode has changed.

C#
VB
using Leadtools.WinForms; 
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
 
public void RasterPictureBox_FrameChanged() 
{ 
   MyForm2 form = new MyForm2(); 
   form.ShowDialog(); 
} 
 
class MyForm2 : Form 
{ 
   RasterPictureBox thePictureBox; 
 
   public MyForm2() 
   { 
      // Create the raster PictureBox 
      thePictureBox = new RasterPictureBox(); 
      thePictureBox.Dock = DockStyle.Fill; 
      thePictureBox.BorderStyle = BorderStyle.Fixed3D; 
      thePictureBox.UseDpi = false; 
 
      // Set the paint properties 
      RasterPaintProperties p = new RasterPaintProperties(); 
      p.PaintDisplayMode = RasterPaintDisplayModeFlags.Bicubic; 
      p.PaintEngine = RasterPaintEngine.GdiPlus; 
      p.UsePaintPalette = true; 
      thePictureBox.PaintProperties = p; 
 
      Controls.Add(thePictureBox); 
      thePictureBox.BringToFront(); 
 
      // load an image into the viewer 
      RasterCodecs codecs = new RasterCodecs(); 
      thePictureBox.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "eye.gif")); 
      codecs.Dispose(); 
 
      thePictureBox.FrameChanged += new EventHandler<RasterPictureBoxFrameChangedEventArgs>(thePictureBox_FrameChanged); 
   } 
 
   void thePictureBox_FrameChanged(object sender, RasterPictureBoxFrameChangedEventArgs e) 
   { 
      Text = string.Format("Playing Frame({0})", e.Index); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; 
} 
Imports Leadtools.WinForms 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.Drawing 
 
Public Sub RasterPictureBox_FrameChanged() 
   Dim form As MyForm2 = New MyForm2() 
   form.ShowDialog() 
End Sub 
 
Private Class MyForm2 : Inherits Form 
   Private thePictureBox As RasterPictureBox 
 
   Public Sub New() 
      ' Create the raster PictureBox 
      thePictureBox = New RasterPictureBox() 
      thePictureBox.Dock = DockStyle.Fill 
      thePictureBox.BorderStyle = BorderStyle.Fixed3D 
      thePictureBox.UseDpi = False 
 
      ' Set the paint properties 
      Dim p As RasterPaintProperties = New RasterPaintProperties() 
      p.PaintDisplayMode = RasterPaintDisplayModeFlags.Bicubic 
      p.PaintEngine = RasterPaintEngine.GdiPlus 
      p.UsePaintPalette = True 
      thePictureBox.PaintProperties = p 
 
      Controls.Add(thePictureBox) 
      thePictureBox.BringToFront() 
 
      ' load an image into the viewer 
      Dim codecs As RasterCodecs = New RasterCodecs() 
      thePictureBox.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "eye.gif")) 
      codecs.Dispose() 
 
      AddHandler thePictureBox.FrameChanged, AddressOf thePictureBox_FrameChanged 
   End Sub 
 
   Private Sub thePictureBox_FrameChanged(ByVal sender As Object, ByVal e As RasterPictureBoxFrameChangedEventArgs) 
      Text = String.Format("Playing Frame({0})", e.Index) 
   End Sub 
End Class 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" 
End Class 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.WinForms Assembly