xamarin.formsgifffimageloading

Xamarin forms: Gif image is not working with FFimageloading in UWP


I am using FFImageLoading for playing a gif file in my project. It is working fine on android and ios but not working in UWP.

I have added the following NuGet packages to every project in my solution.

  1. Xamarin.FFImageLoading.

  2. Xamarin.FFImageLoading.Forms.

  3. Xamarin.FFImageLoading.Transformations.

  4. Xamarin.FFImageLoading.Svg.

  5. Xamarin.FFImageLoading.Svg.Forms.

Added the following code on UWP MainPage.xaml.cs:

FFImageLoading.Forms.Platform.CachedImageRenderer.Init();

In XAML:

xmlns:ffimageloading="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"

<ffimageloading:SvgCachedImage 
    HorizontalOptions="CenterAndExpand" 
    x:Name="GifImage" 
    Grid.Row="0"
    VerticalOptions="CenterAndExpand"
    WidthRequest="200"
    HeightRequest="200"
    Source="ic_dove_loading_xx.gif"/>

Gif is not playing in the UWP app. Are there any additional settings in the windows part for UWP?


Solution

  • This is not available for UWP in my knowledge, Last time I checked it was an enhancement that was not added.

    UPDATE

    When you check FFImageLoading's Github issues there is an open issue about this where the reason is explained by the Author.

    It's because FFImageLoading is using WriteableBitmap internally. We'll need to add a new logic to handle this and don't use WriteableBitmap for animated gifs.

    The good thing is that they have added this as a future enhancement for v2.5 which should be out soon!