Display GIF in a WP7 application with Silverlight

后端 未结 6 749
一向
一向 2020-11-27 06:10

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 workin

6条回答
  •  情歌与酒
    2020-11-27 06:25

    In fact, it's working, but it lacks some documentation.

    After some troubles, here's how to use it :

    • reference ImageTools
    • reference ImageTools.Controls
    • reference ImageTools.IO.Gif

    Add namespace in xaml :

    xmlns:imagetools="clr-namespace:ImageTools.Controls;assembly=ImageTools.Controls" 
    

    And resources :

    
        
    
    

    Then use the control with the converter :

    
    

    Your ImageSource should be an Uri, for example :

    ImageSource = new Uri("http://mysite/my.gif", UriKind.Absolute);
    

    Don't forget to add decoded :

    ImageTools.IO.Decoders.AddDecoder();
    

提交回复
热议问题