O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing the Format

Changing a media file’s format is done the same way as changing its quality. It comes down to your choice of MediaEncodingProfile (and in this example, what file extensions you force in the file picker):

async Task ConvertUserSelectedMp4ToWmv(){  // Get a source MP4 file from the user  FileOpenPicker openPicker = new FileOpenPicker();  openPicker.FileTypeFilter.Add(".mp4");  StorageFile sourceFile = await openPicker.PickSingleFileAsync();  if (sourceFile != null)  {    // Get a target WMV file from the user    FileSavePicker savePicker = new FileSavePicker();    savePicker.FileTypeChoices.Add("WMV file" , new string[] { ".wmv" });    StorageFile targetFile = await savePicker.PickSaveFileAsync(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required