Private void PrepareAnimation(BitmapImage aBitmapImage) Get īeginAnimation(FrameIndexProperty, null) I guess that the gif has 10 frames per second. The event ChangingFrameIndex changes the source property to the frame corresponding to the FrameIndex (that is in the decoder). I post a solution extending the image control and using the Gif Decoder. ImageBehavior.SetAnimatedSource(img, image) Īs per josh2112's comment if you want to add animated GIF support to your Silverlight project then use /XamlAnimatedGif/XamlAnimatedGif The package is really neat, you can set some attributes like below Īnd you can use it in your code as well: var image = new BitmapImage() The result was weird, choppy animation with weird artifacts.Īnd to use it, at a new namespace to the Window where you want to add the gif image and use it as below I couldn't get the most popular answer to this question (above by Dario) to work properly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |