AnimatedImage.Wpf 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package AnimatedImage.Wpf --version 1.0.3                
NuGet\Install-Package AnimatedImage.Wpf -Version 1.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AnimatedImage.Wpf" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AnimatedImage.Wpf --version 1.0.3                
#r "nuget: AnimatedImage.Wpf, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AnimatedImage.Wpf as a Cake Addin
#addin nuget:?package=AnimatedImage.Wpf&version=1.0.3

// Install AnimatedImage.Wpf as a Cake Tool
#tool nuget:?package=AnimatedImage.Wpf&version=1.0.3                

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 431 10/22/2023
1.0.3 140 9/5/2023
1.0.1 152 8/7/2023