Possible to make an animated Sprite using WPF?  
Author Message
Dudley





PostPosted: Windows Presentation Foundation (WPF), Possible to make an animated Sprite using WPF? Top

I'm trying to decide what might be the best way to cycle through a series of individual images or frames to give the impression of animation - similar to how an animated gif file works.

I have yet to find a single example of this kind of keyframe animation within WPF. There are probably various ways one could acheive this but I wondered if anyone could point me to an existing example using either XAML or code.

I'm currently thinking along the lines of finding a way to change the ImageSource of an ImageBrush at regular intervals - but is there a better way



Visual Studio 200836  
 
 
Dudley





PostPosted: Windows Presentation Foundation (WPF), Possible to make an animated Sprite using WPF? Top

I guess from the lack of response this is difficult to do with WPF

With a lack of any kind of frame based animation system I cant see how WPF could ever be considered a "Flash Killer". From the kind of animation examples I've seen with WPF so far I have to say that Flash's animation abilities still seem to far exceed WPFs.


 
 
Douglas Stockwell





PostPosted: Windows Presentation Foundation (WPF), Possible to make an animated Sprite using WPF? Top

Animating the ImageSource as you described sounds fine, you can do this using an ObjectAnimationUsingKeyFrames. As for if it's the best solution or not, it's hard to say. WPF hasn't been around long enough for all the best practices to have evolved yet.