A library to display animated GIF, PNG and WebP images in AvaloniaUI
$ dotnet add package AnimatedImage.AvaloniaA simple library to display animated GIF images, animated PNG images and animated WEBP images in AvaloniaUI, usable in XAML or in code.
It's very easy to use: in XAML, instead of setting the Source property, set the AnimatedSource attached property to the image you want:
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:anim="https://github.com/whistyun/AnimatedImage.Avalonia"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Image anim:ImageBehavior.AnimatedSource="Images/animated.gif" />
You can also specify the repeat behavior (the default is 0x, which means it will use the repeat count from the GIF metadata):
<Image anim:ImageBehavior.RepeatBehavior="3x"
anim:ImageBehavior.AnimatedSource="Images/animated.gif" />
To use WebP, AnimatedImage.Native library is required.