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?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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)); } |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |