I would like to display gif in my WP7 application. Is there some way to achieve this ?
I've tryed this one http://imagetools.codeplex.com/ but can't make it working with WP7.
Thanks in advance for any help
I would like to display gif in my WP7 application. Is there some way to achieve this ?
I've tryed this one http://imagetools.codeplex.com/ but can't make it working with WP7.
Thanks in advance for any help
Check out Jamie Rodriguez's post here on using GIFs with WP7. He uses the ImageTools project from CodePlex.
http://blogs.msdn.com/b/jaimer/archive/2010/11/23/working-with-gif-images-in-windows-phone.aspx
Is it an animated GIF? If not, I would try converting the GIF to another supported file format before using it in your app.
I struggled to get the accepted answer working. The following solution worked for me to display a static gif.
Classes.Util.UiThread is a helper class I use to call the UI Thread
this.ImageResponse is a standard image control
In fact, it's working, but it lacks some documentation.
After some troubles, here's how to use it :
Add namespace in xaml :
And resources :
Then use the control with the converter :
Your ImageSource should be an Uri, for example :
Don't forget to add decoded :
WP7 Silverlight supports JPG/PNG.
As per http://msdn.microsoft.com/en-us/library/ff462087(VS.92).aspx the Silverlight image control does not support GIF files.
By using ImageTools you are converting the GIF file to something else on the fly on the device. If you are using gif files that you have control of (i.e. You are bundling them in the XAP or they are coming from your webserver.) you should use converted versions of these files.
This will mean that the app has to do less.
The knock on effect is that:
1. You will have to write less code.
2. The app will have to do less work and so will perform slightly better.
Of course, this doesn't cover animated GIFs. For these you'll need to use a different approach.