WPF Animated GIF

NOTE: this project has moved: WpfAnimatedGif repository on GitHub
I will try to keep the CodePlex repository up to date, but issues should now be reported on GitHub.

Nuget package available here: WpfAnimatedGif.
Current stable version: WPF Animated GIF 1.4.12 (Change log)

A simple library to display animated GIF images in WPF, 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 x:Class="WpfAnimatedGif.Demo.MainWindow"
        Title="MainWindow" Height="350" Width="525">
        <Image gif: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 gif:ImageBehavior.RepeatBehavior="3x"
               gif:ImageBehavior.AnimatedSource="Images/animated.gif" />

And of course you can also set the image in code:

var image = new BitmapImage();
image.UriSource = new Uri(fileName);
ImageBehavior.SetAnimatedSource(img, image);

See the documentation for more details on usage.


  • 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)

Last edited Jan 3 at 7:08 PM by tom103, version 28