在 Window Phone 8.1 中无法以读写模式打开图像?
Image not opening in Read Write mode in Window Phone 8.1?
我正在使用 FileopenPicker 从 PictureLibrary select 图片但是在 selection 之后我无法使用 FileAccessMode.ReadWrite 打开它它给了我异常
Windows.Storage.StorageFile.OpenAsync(FileAccessMode accessmode)
这是我以读写模式打开文件的代码
StorageFile file = args.Files[0];
var stream = await file.OpenAsyn(FileAccessMode.ReadWrite); // Exception occur on this line
BitmapImage bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage();
await bitmapImage.setSourceAsyc(stream);
请帮我解决这个问题。
刚刚在测试代码中试了一下,对我有用:
StorageFile newFile = await file.CopyAsync(ApplicationData.Current.LocalFolder, file.Name, NameCollisionOption.GenerateUniqueName);
using (var stream = await newFile.OpenAsync(FileAccessMode.ReadWrite))
{
}
我正在使用 FileopenPicker 从 PictureLibrary select 图片但是在 selection 之后我无法使用 FileAccessMode.ReadWrite 打开它它给了我异常
Windows.Storage.StorageFile.OpenAsync(FileAccessMode accessmode)
这是我以读写模式打开文件的代码
StorageFile file = args.Files[0];
var stream = await file.OpenAsyn(FileAccessMode.ReadWrite); // Exception occur on this line
BitmapImage bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage();
await bitmapImage.setSourceAsyc(stream);
请帮我解决这个问题。
刚刚在测试代码中试了一下,对我有用:
StorageFile newFile = await file.CopyAsync(ApplicationData.Current.LocalFolder, file.Name, NameCollisionOption.GenerateUniqueName);
using (var stream = await newFile.OpenAsync(FileAccessMode.ReadWrite))
{
}