public static BitmapImage Capture( MediaPlayer player, double seconds, double maxWidth = 640, CRGBA3x3FilteringProc filtering = null, int dpi = Image.DEFAULT_dpi ) { if (player is null) { return(null); } // 指定位置へシーク player = (MediaPlayer)player.CloneCurrentValue(); double volume = player.Volume; player.Volume = 0; player.Position = TimeSpan.FromSeconds(seconds); player.Pause(); // 読み込みが完了するまで待機 waitMediaSetup(player, seconds); player.Volume = volume; return(capture(player, maxWidth, filtering, dpi)); }
public static MediaPlayer Seek(MediaPlayer player, double seconds) { if (player is null) { return(null); } // 指定位置へシーク player = (MediaPlayer)player.CloneCurrentValue(); double volume = player.Volume; player.Volume = 0; player.Pause(); player.Position = TimeSpan.FromSeconds(seconds); // 読み込みが完了するまで待機 waitMediaSetup(player, seconds); player.Volume = volume; return(player); }