AnimatedImage.Wpf
1.0.1
See the version list below for details.
dotnet add package AnimatedImage.Wpf --version 1.0.1
NuGet\Install-Package AnimatedImage.Wpf -Version 1.0.1
<PackageReference Include="AnimatedImage.Wpf" Version="1.0.1" />
paket add AnimatedImage.Wpf --version 1.0.1
#r "nuget: AnimatedImage.Wpf, 1.0.1"
// Install AnimatedImage.Wpf as a Cake Addin #addin nuget:?package=AnimatedImage.Wpf&version=1.0.1 // Install AnimatedImage.Wpf as a Cake Tool #tool nuget:?package=AnimatedImage.Wpf&version=1.0.1
A simple library to display animated GIF images and animated PNG images in WPF and AvaloniaUI, usable in XAML or in code.
How to use
These properties are compatible with those of WpfAnimatedGif.
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 x:Class="WpfAnimatedGif.Demo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:anim="https://github.com/whistyun/AnimatedImage.Wpf"
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" />
And of course you can also set the image in code:
var image = new BitmapImage();
image.BeginInit();
image.UriSource = new Uri(fileName);
image.EndInit();
ImageBehavior.SetAnimatedSource(img, image);
Features
- Animates GIF images in a normal
Image
control; no need to use a specific control - Takes actual frame duration into account
- Repeat behavior can be specified; if unspecified, the repeat count from the GIF metadata is used
- Notification when the animation completes, in case you need to do something after the animation
- Animation preview in design mode (must be enabled explicitly)
- Support for controlling the animation manually (pause/resume/seek)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net6.0-windows7.0 is compatible. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETCoreApp 3.1
- SharpCompress (>= 0.33.0)
-
.NETFramework 4.6.2
- SharpCompress (>= 0.33.0)
-
net6.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.