wpf WPF图像源gif动画

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12743603/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 05:40:29  来源:igfitidea点击:

WPF image source gif animation

c#wpf

提问by Alvin

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.

如何让 GIF 动画与下面的代码一起工作?问题是图像会相应地更改为几个不同的图像。

WPF:

WPF:

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

Code behind: public readonly DependencyProperty ImageProperty;

背后的代码: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/

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

回答by Nickon

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

我用它来完成我的gifs工作:http: //www.vcskicks.com/csharp_animated_gif.php

[edit]

[编辑]

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

我找到了一些东西WPFhttp: //wpfanimatedgif.codeplex.com/

But I didn't test it!

但是我没有测试!