-1

I'm using a button to select an image from the Pictures folder, what I want is to save that selected image to the app's Local Storage in order to be able to show that image using binding in a GridView. Is this posible? How could I do it? Thanks

1 Answer 1

1

You would do it something like this:

FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");

StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null)
{
    await file.CopyAsync(Windows.Storage.ApplicationData.Current.LocalFolder);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.