你的位置:首页 > ASP.net教程

[ASP.net教程]WPF中使用MediaElement显示GIF


<MediaElement x:Name="myGif" MediaEnded="myGif_MediaEnded" UnloadedBehavior="Manual"   Source="file://C:\waiting.GIF" LoadedBehavior="Play" Stretch="None"/>

  private void myGif_MediaEnded(object sender, RoutedEventArgs e)  {    myGif.Position = new TimeSpan(0, 0, 1);    myGif.Play();  }