2013-02-24 99 views
0

我需要將本地存儲文件夾中的圖像保存到從SavePicker中選擇的文件。 我應該使用流嗎? 這裏是我的代碼:從Windows 8的SavePicker將文件流式傳輸到文件

  StorageFile file = await savePicker.PickSaveFileAsync(); 
      if (null != file) 
      { 
       var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; 
       StorageFile current_photo = await localFolder.GetFileAsync(img.Tag.ToString()); 

       // TODO Stream from current_photo to file 
      } 

回答

1

CopyAsync應該這樣做:

await current_photo.CopyAndReplaceAsync(file); 
相關問題