【发布时间】:2015-10-12 23:54:25
【问题描述】:
我想使用 MediaElement 控件在 WPF 应用程序中重复播放 GIF (.gif) 文件。 下面我附上了我目前使用的代码。
<MediaElement x:Name="recImageMedia" Height="67" Margin="43,-70,816.2,0" LoadedBehavior="Play" Source="file://C:\Users\documents\visual studio 2013\Projects\Application\TempApplication\Snapshots\recordanim.gif" Visibility="Visible" />
【问题讨论】:
-
private void gifAnimation_MediaEnded(object sender, RoutedEventArgs e) { gifAnimation.Position = new TimeSpan(0,0,1); gifAnimation.Play(); }
-
这对我有用.. 谢谢
标签: c# wpf xaml visual-studio-2013 mediaelement