Alvin
Alvin

Reputation: 8519

WPF image source gif animation

How do I get the GIF animated to work with the code below? The problem is the image will change accordinly to few different image.

WPF:

<Image Source="{Binding ElementName=L, Path=Image}" Height="400" Width="600" Stretch="None" />

Code behind: public readonly DependencyProperty ImageProperty;

    public ImageSource ImageStatus
    {
        get { return (ImageSource)GetValue(ImageProperty); }
        set { SetValue(ImageProperty, value); }
    }

Image = new BitmapImage(new Uri("/L;component/Images/test.gif", UriKind.Relative));

EDITED:

http://eladm.wordpress.com/2009/04/02/animated-gif-support-behavior/

Upvotes: 2

Views: 6159

Answers (1)

Nickon
Nickon

Reputation: 10156

I have used this to make my gifs work: http://www.vcskicks.com/csharp_animated_gif.php

[edit]

I have found something for WPF: http://wpfanimatedgif.codeplex.com/

But I didn't test it!

Upvotes: 1

Related Questions