One movement with ImageAnimator


Animation with ImageAnimator.

In .net Animation of the pictures are very easy to do it.
We have the class ImageAnimator. It is used to handle the animation
in .net





using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

public class MyForm : Form
{
private Bitmap MyBitmap;

public MyForm()
{
MyBitmap = new Bitmap("Nathan.jpg");
ImageAnimator.Animate(MyBitmap, new EventHandler(this.OnFrameChanged));
this.Paint += new System.Windows.Forms.PaintEventHandler(this.MyForm_Paint);
}
public static void Main(){
Application.Run(new MyForm());
}

private void OnFrameChanged(object o, EventArgs e)
{
this.Invalidate();
}

private void MyForm_Paint(object sender, PaintEventArgs e)
{
ImageAnimator.UpdateFrames();
e.Graphics.DrawImage(this.MyBitmap, new Point(0, 0));
}
}




We are handling the event MyForm_Paint for your animation.
The above code will clearly expalin how to do the animation using the
image animatore

By
Nathan


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: