我到处找,但在拍摄后找不到如何保存我的照片。我使用 Windows 8 媒体捕获,捕获后,我将其显示在我的页面上。但不知道如何将其保存到特定位置。
这就是我拍照的方式,非常经典:
private async void Camera_Clicked(object sender, TappedRoutedEventArgs e)
{
TurnOffPanels();
CameraCaptureUI camera = new CameraCaptureUI();
camera.PhotoSettings.CroppedAspectRatio = new Size(16, 9);
StorageFile photo = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (photo != null)
{
BitmapImage bmp = new BitmapImage();
IRandomAccessStream stream = await photo.OpenAsync(FileAccessMode.Read);
bmp.SetSource(stream);
ImageSource.Source = bmp;
ImageSource.Visibility = Visibility.Visible;
appSettings[photoKey] = photo.Path;
}
}
这就是我在服用后重新加载它的方式:
private async Task ReloadPhoto(String photoPath)
{
StorageFile photo = await StorageFile.GetFileFromPathAsync(photoPath);
BitmapImage bmp = new BitmapImage();
using (IRandomAccessStream stream = await photo.OpenAsync(FileAccessMode.Read))
{
bmp.SetSource(stream);
}
}
有谁知道如何保存照片?
问候。