I managed to display the gif in a windows 8 metro application by simply translating the gifs into jpegs and then starting an endless loop.
The code is as follows:
public async void UpdateImage () {
await Task.Delay(300); var frame = this.Frame.CurrentSourcePageType.Name; if (frame != ("CURRENTFRAME")) return; if (count <= 4) { var img = (BitmapImage) Resources["bitmap" + count]; imgTap.Source = img; UpdateLayout(); count++; UpdateImage(); } else { count = 1; UpdateImage(); } }
So basically I save the converted jpegs in my page.resources and then call them as bitmap1, bitmap2 .. etc. I check if the current frame is the frame that the gif should display, otherwise the gif code will work in the background for all the time, which is a waste of memory and processor. Just call this method for any of the Loaded method, and it should work fine.
Bharadwaj sampath
source share