var filePicker = new FileOpenPicker();
filePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
filePicker.ViewMode = PickerViewMode.Thumbnail;
filePicker.FileTypeFilter.Clear();
filePicker.FileTypeFilter.Add(".jpg");
filePicker.FileTypeFilter.Add(".jpeg");
filePicker.FileTypeFilter.Add(".png");
var files = await filePicker.PickMultipleFilesAsync();
if (files != null)
{
foreach (var file in files)
{
using (IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
{
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(fileStream);
images.Add(bitmapImage);
}
}
}
flpView.ItemsSource = images;
loadTimer();
上面的代码正在运行。我可以从本地和facebook等选择多张照片,也可以将选中的图像添加到flipview,但我想存储来自本地,skydrive和facebook图像的图像路径。我想要这个,因为当应用程序启动时,flipview应该自动填充路径中的图像。如果找不到路径,则应在设置超级按钮中更改。这就是主意。但我认为不需要整合facebook。
答案 0 :(得分:0)
使用选择器打开文件时,您获得的是存储文件而不是传统文件。不同之处在于存储文件不需要具有与之关联的路径。
Windows.Storage.AccessCache提供了缓存存储项以供将来使用的方法。