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 (permalink)  
Old 07-30-2007, 12:38 AM
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
Sponsored Links
  #2 (permalink)  
Old 07-30-2007, 12:42 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo 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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we move an image programmatically in pocket pc without flickering using C#? mobilegeek Mobile Software Development 3 04-23-2008 09:17 PM
Windows application questions Mramesh C# Programming 15 02-23-2008 03:40 AM
How to change the home screen programmatically Windows Mobile? theone Windows Mobile 1 07-27-2007 06: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 11:10 PM
How can we capture the todays screen image programmatically in windows mobile 5.0 poc mobilegeek C# Programming 1 07-21-2007 01:46 AM


All times are GMT -7. The time now is 08:48 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0