我正在尝试使用FilePicker任务保存视频文件,但是在解决方案中并没有显示FileSavePicker任务。以下是截图:
Windows.Storage.Pickers只显示了4个任务:
- FileExtensionVector
- FileOpenPicker
- PickerLocationId
- PickerViewMode
这是我使用的代码:
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应用程序。