0 Replies - 6699 Views - Last Post: 02 April 2012 - 08:31 AM

#1 Steven_M  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 04-April 11

Frame By Frame Animation with Storyboard

Posted 02 April 2012 - 08:31 AM

Hi I am trying to emulate parts of this tutorial http://compiledexper...utorials/candle But instead of static images, I am getting the images from isolated storage. My problem is it is only displaying the last image on the output from isolated storage and I don't know why because the exact same tutorial is just opening them with the same idea, can you help me please? Thanks

All images are definitely stored in Isolated Storage ,I know this as I used a program to check the files.
I've tried isostore but nothing shows.


private void PlayButton_Click(object sender, RoutedEventArgs e) 
        { 
             
                    try 
                    { 
                        storyboard = new Storyboard 
                        { 
                            Repeatbehavior = Repeatbehavior.Forever 
                        }; 
 
                        var animation = new ObjectAnimationUsingKeyFrames(); 
 
                        Storyboard.SetTarget(animation, CandleImage); 
                        Storyboard.SetTargetProperty(animation, new PropertyPath("Source")); 
                        BitmapImage image = new BitmapImage(); 
 
                        storyboard.Children.Add(animation); 
                        for (int i = 0; i < savedCounter; i++) 
                        { 
                            image.SetSource(isStore.OpenFile("MyImage"+i+".jpg", FileMode.Open));//images from isolated storage 
 
                            var keyframe = new DiscreteObjectKeyFrame 
                            { 
 
                                 KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(50 * i)), 
                                 Value = image//only recieving the last image in isolated storage 
 
                             }; 
 
                             animation.KeyFrames.Add(keyframe); 
                        } 
                    } 
                    catch (Exception) 
                    { 
 
                        //throw; 
                    } 
 
 
                 
                     Resources.Add("CandleStoryboard", storyboard); 
                     storyboard.Begin(); 
 
        } 


Is This A Good Question/Topic? 0
  • +

Page 1 of 1