I have done the candle animation tutorial here but I would like to save this animation and convert it to a video so I can play,pause, rewind and fast forward. how would I go about achieving this. Can you help me?
here is my code
private void OnLoaded(object sender, RoutedEventArgs e)
{
var storyboard = new Storyboard
{
RepeatBehavior = RepeatBehavior.Forever
};
var animation = new ObjectAnimationUsingKeyFrames();
Storyboard.SetTarget(animation, CandleImage);
Storyboard.SetTargetProperty(animation, new PropertyPath("Source"));
storyboard.Children.Add(animation);
for (int i = 1; i <= 60; i++)
{
var keyframe = new DiscreteObjectKeyFrame
{
KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(50 * i)),
Value = String.Format("/Images/candle_{0:D2}.jpg", i)
};
animation.KeyFrames.Add(keyframe);
}
Resources.Add("CandleStoryboard", storyboard);
storyboard.Begin();
}
You can do everything like that with the Storyboard. See methods like Pause() and Resume() and the SpeedRatio property.