Hello,
I want to create an animation, based on an animated gif image. In the following program I can view the Image, but not the Image animation.
I use .NET 4.0 Here is the code of the partial class:
- using System;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Windows.Forms;
-
- namespace DrawingBasicsAnimation
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void FillRectangle1(object sender, PaintEventArgs e)
- {
- itsme = new Bitmap(@"..\..\..\..\..\..\pics\agif1.gif");
- ImageAnimator.Animate(itsme, new EventHandler(this.OnFrameChanged));
- ImageAnimator.UpdateFrames();
- e.Graphics.DrawImage(itsme, new PointF(0, 0));
- }
- private void OnFrameChanged(object o, EventArgs e)
- {
- this.Invalidate();
- }
- private Bitmap itsme;
- }
- }
What am I doing wrong?