Reputation: 484
I making simple game in the WinRT (C# + XAML) with animations.
I have every key frame as a png file. I create animation from ObjectAnimationUsingKeyFrames
class witch changes Source property of Image control. It's work, but at 1st time of each animation can be seen 'blink' effect when application load BitmapImages for specific animation.
It is possible to load each of BitmapImage before using it?
Upvotes: 0
Views: 552
Reputation: 5575
There are a couple of ways to do this. One way to be would to load it manually via a Stream like this. You could have references to the different BitmapImage
objects in your ViewModel
.
The second option would be to manually precache all the images beforehand. Draw them on the screen in the background once. You may even be able to do this with Opactiy at 0 so that there's no chance of them being seen.
Upvotes: 1