【发布时间】:2015-11-26 12:02:50
【问题描述】:
如何让 GIF 在 Windows Phone 8.1 应用程序上播放?我看到普通的图像控件 simplay 将 gif 显示为静态图像。我将如何像 Internet Explorer 那样在运行时实际播放 GIF?
【问题讨论】:
标签: c# windows xaml windows-phone-8.1 windows-phone
如何让 GIF 在 Windows Phone 8.1 应用程序上播放?我看到普通的图像控件 simplay 将 gif 显示为静态图像。我将如何像 Internet Explorer 那样在运行时实际播放 GIF?
【问题讨论】:
标签: c# windows xaml windows-phone-8.1 windows-phone
您可以使用XamlAnimatedGif 来执行此操作。
它非常易于使用。首先将命名空间添加到 Page 标签:
xmlns:gif="using:XamlAnimatedGif"
然后像这样显示 GIF:
<Image gif:AnimationBehavior.SourceUri="/Images/animated.gif" />
从github页面看,它支持WPF、Windows 8.1、Windows Phone 8.1和通用Windows平台。
【讨论】:
<Image x:Name="MyImage" gif:AnimationBehavior.SourceUri="{Binding uricheck}" ></Image> 。我设法在普通图像控件中将 gif 显示为静态图像,但 Image gif: 保持空白。