0

画像をライブラリにコピーするためにここに正確に行く必要はありません。親切に助けてください

private async void Button_Click_2(object sender, RoutedEventArgs e)
    {

        if (img != null)
        {
           try
            {
                Windows.Storage.Pickers.FileSavePicker SavePicker = new Windows.Storage.Pickers.FileSavePicker();
                SavePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop;
                SavePicker.DefaultFileExtension = ".png";
                SavePicker.FileTypeChoices.Add("PNG", new string[] { ".png" });
                SavePicker.FileTypeChoices.Add("JPG", new string[] { ".jpg" });
                StorageFile filesave = await SavePicker.PickSaveFileAsync();
            }

            catch (Exception)
            {
                var MsgDlg = new MessageDialog("Oops something went wrong.", "Error while saving");
                MsgDlg.ShowAsync();
            }
        }
        else
        {
            var MsgDlg = new MessageDialog("Ooops Something went wrong.", "Error while saving");
            await MsgDlg.ShowAsync();
        }
4

1 に答える 1