Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Animated gif-problem
Dmitrij Solov
8y
282
1
Reply
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;
//animated image issue
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?
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
upload image from excel into database in winforms using c#
Unique Random number