ImageAnimator

ImageAnimator

System.Drawing (system.drawing.dll) sealed class

This class provides static methods to support the animation of an Image class that contains multiple frames in the System.Drawing.Imaging.FrameDimension.Time dimension: a complex way of saying a time-based image sequence.

The Animate() method takes an image and a callback delegate, which is called whenever a new frame is needed. You can then paint the image on the appropriate Graphics surface at that time. StopAnimate() brings the animation to a halt.

There is a CanAnimate() method that tells you whether a particular Image has multiple frames in the time dimension, and an UpdateFrames() function that advances to the next frame immediately.

This may seem like a complex way of allowing you to render an animated GIF (not forgetting your UniSys licensing, of course), but it means the image framework can provide much more complex animation schemes than thatkey frame-based vector graphics animation for a cartoon, say, or on-the-fly interpolation of bitmap frames. And if you do just want basic drop-in-and-go animation control, the System.Windows.Forms.PictureBox component will do the job.

 public sealed class  ImageAnimator  {  // Public Static Methods  public static void  Animate  (Image  image  , EventHandler  onFrameChangedHandler  );    public static bool  CanAnimate  (Image  image  );    public static void  StopAnimate  (Image  image  , EventHandler  onFrameChangedHandler  );    public static void  UpdateFrames  ();    public static void  UpdateFrames  (Image  image  ); } 


. Net Windows Forms in a Nutshell
.NET Windows Forms in a Nutshell
ISBN: 0596003382
EAN: 2147483647
Year: 2002
Pages: 794

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net