在Windows Phone 8.1上播放GIF

Ahm*_*asi 1 c# windows xaml windows-phone windows-phone-8.1

如何在Windows Phone 8.1应用程序上播放GIF?我看到普通的Image控件simplay将gif显示为静态图像.我如何在运行时实际播放GIF,就像Internet Explorer一样?

Mat*_*att 6

您可以使用XamlAnimatedGif执行此操作.

它非常易于使用.首先,将名称空间添加到Page标记:

xmlns:gif="using:XamlAnimatedGif"
Run Code Online (Sandbox Code Playgroud)

然后显示GIF是这样的:

<Image gif:AnimationBehavior.SourceUri="/Images/animated.gif" />
Run Code Online (Sandbox Code Playgroud)

从github页面,它支持WPF,Windows 8.1,Windows Phone 8.1和通用Windows平台.