IT Community - Software Programming, Web Development and Technical Support

How to animate an image using C# windows application programmatically?

This is a discussion on How to animate an image using C# windows application programmatically? within the C# Programming forums, part of the Software Development category; How to animate an image using C# windows application programmatically?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-29-2007, 11:38 PM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Question How to animate an image using C# windows application programmatically?

How to animate an image using C# windows application programmatically?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 07-29-2007, 11:42 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 881
kingmaker is on a distinguished road
Send a message via MSN to kingmaker
Default Re: How to animate an image using C# windows application programmatically?

Bitmap animatedImage = new Bitmap(//file path);
bool currentlyAnimating = false;

public void animate()
{
if (!currentlyAnimating)
{
//Begin the animation only once.
ImageAnimator.Animate(animatedImage, new EventHandler(this.OnFrameChanged));
currentlyAnimating = true;
}
}

private void OnFrameChanged(object o, EventArgs e)
{
//Force a call to the Paint event handler.
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
//Begin the animation.
animate();
//Get the next frame ready for rendering.
ImageAnimator.UpdateFrames();
//Draw the next frame in the animation.
e.Graphics.DrawImage(this.animatedImage, new Point(50, 50));
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
windows application saravanan ASP and ASP.NET Programming 2 04-23-2008 11:45 PM
Can we move an image programmatically in pocket pc without flickering using C#? mobilegeek Mobile Software Development 3 04-23-2008 08:17 PM
How to change the home screen programmatically Windows Mobile? theone Windows Mobile 1 07-27-2007 05:22 AM
Is there a way to Lock a Windows Mobile Device Programmatically so that no user can u itbarota Windows Mobile 0 07-23-2007 10:10 PM
How can we capture the todays screen image programmatically in windows mobile 5.0 poc mobilegeek C# Programming 1 07-21-2007 12:46 AM


All times are GMT -7. The time now is 08:00 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0