2
我想在Windows Phone的8.1.I通過文件選擇器選擇了一個圖像workk使用此代碼工作與圖像中的Windows Phone通過文件選取回升8.1
private async void gallery_Tapped(object sender, TappedRoutedEventArgs e)
{
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");
// Launch file open picker and caller app is suspended and may be terminated if required
openPicker.PickSingleFileAndContinue();
}
public async void ContinueFileOpenPicker(FileOpenPickerContinuationEventArgs args)
{
if (args.Files.Count > 0)
{
StorageFile file=args.Files[0];
IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(fileStream);
MyImage.Source=bitmapImage;
}
else
{
}
}
選擇了一個圖像
ContinueFileOpenPicker不執行我試過this但無法理解that.Can任何蒞臨指導我一步一步我應該怎麼做,使之work.Thanks
嘛阿爾季cle你鏈接包含一步一步的指導。看起來你不會在應用程序恢復時隨時隨地調用延續代碼。 – Stilgar
可以ü發佈一些代碼 –
您鏈接的文章不僅包含代碼,但有一個鏈接到一個完整的示例應用程序。 – Stilgar