我正在尝试使用 FilePicker 任务保存视频文件,但它没有在解决方案中显示 FileSavePicker 任务。下面附上屏幕截图
Windows.Storage.Pickers 中仅显示 4 个任务
- 文件扩展向量
- 文件打开选择器
- 选择器位置 ID
- 选择器视图模式
这是我正在使用的代码
async void TrimVideoFile()
{
Windows.Storage.StorageFile source;
Windows.Storage.StorageFile destination;
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
openPicker.FileTypeFilter.Add(".wmv");
openPicker.FileTypeFilter.Add(".mp4");
source = await openPicker.PickSingleFileAsync();
var savePicker = new Windows.Storage.Pickers.FileSavePicker()
savePicker.SuggestedStartLocation =
Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
savePicker.DefaultFileExtension = ".mp4";
savePicker.SuggestedFileName = "New Video";
savePicker.FileTypeChoices.Add("MPEG4", new string[] { ".mp4" });
destination = await savePicker.PickSaveFileAsync();
// Method to perform the transcoding.
TrimFile(source, destination);
}
它只显示 4 个任务。如何使用 FileSavePicker 任务。我正在使用 Visual Studio 2012,我的目标应用程序是 Windows Phone 8.0 应用程序。