0

I have created an story boarding animation from png images using expression blend .When I play animation for the first time it flickers but when I play for second time it not flicker ? Why? Is there any way that animation not flicker for first time?

Here is my code

<Storyboard x:Name="Storyboard1">
            <ObjectAnimationUsingKeyFrames Duration="0:0:5.0"
                                                   Storyboard.TargetName="image" 
                                                   Storyboard.TargetProperty="Source">
                <ObjectAnimationUsingKeyFrames.KeyFrames>
                    <DiscreteObjectKeyFrame KeyTime="0:0:0.01">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a01.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>


                    <DiscreteObjectKeyFrame KeyTime="0:0:0.2">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a02.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="0:0:0.6">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a03.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="0:0:1.0">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a04.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="0:0:1.4">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a05.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="0:0:1.8">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a06.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="0:0:2.2">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a07.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="0:0:2.6">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a08.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                    <DiscreteObjectKeyFrame KeyTime="0:0:3.0">
                        <DiscreteObjectKeyFrame.Value>
                            <BitmapImage UriSource="animation/entering toilet/a09.png"/>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                </ObjectAnimationUsingKeyFrames.KeyFrames>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard> 
user3090763
  • 1,089
  • 1
  • 10
  • 24
  • Hmm, is this basically a duplicate of your only [other question](http://stackoverflow.com/questions/22309460/smooth-animation-in-expression-blend-for-window-store-apps-from-png-images)? – Chris W. Mar 11 '14 at 19:22
  • I search on google it says images preload first time – user3090763 Mar 11 '14 at 19:38
  • Pre-load? I don't think that's correct when you're dynamically changing the path like that since they don't immediately exist in the tree (which would explain your first round flicker.) However, the way you're going lets say for example each image file is 50k, so at 9 images for just one animation, you've added 450k to your project....for just one animation. Whereas that quick & dirty example I gave you on the other answer accomplishes the same thing with only like 5k of space, around the same amount of lines of xaml, and less overhead. Just a thought. ;) – Chris W. Mar 11 '14 at 19:45

0 Answers0