WPF中播放GIF图片
1.安装WpfAnimatedGif Nuget包
2.程序中使用
Xaml:添加引用 xmlns:gif=“http://wpfanimatedgif.codeplex.com”
<Window x:Class="GIFPlayer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:gif="http://wpfanimatedgif.codeplex.com"
xmlns:local="clr-namespace:GIFPlayer"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800" Background="Transparent">
<Grid>
<Image gif:ImageBehavior.AnimatedSource="Images/cxk.gif" />
</Grid>
</Window>