如何让 GIF 动画与下面的代码一起使用?问题是图像会相应地改变到几个不同的图像。
可湿性工作基金会:
<Image Source="{Binding ElementName=L, Path=Image}" Height="400" Width="600" Stretch="None" />
代码隐藏: 公共只读依赖项属性图像属性;
public ImageSource ImageStatus
{
get { return (ImageSource)GetValue(ImageProperty); }
set { SetValue(ImageProperty, value); }
}
Image = new BitmapImage(new Uri("/L;component/Images/test.gif", UriKind.Relative));
编辑:
http://eladm.wordpress.com/2009/04/02/animated-gif-support-behavior/
我用它来使我的gifs
工作:http://www.vcskicks.com/csharp_animated_gif.php
[编辑]
我找到了WPF
的东西:http://wpfanimatedgif.codeplex.com/
但我没有测试它!