private async void Button_Click2(object sender, RoutedEventArgs e)
{
CameraCaptureUI camera = new CameraCaptureUI();
camera.PhotoSettings.AllowCropping = true;
camera.PhotoSettings.CroppedAspectRatio = new Size(16, 9);
StorageFile photo = await camera.CaptureFileAsync(CameraCaptureUIMode.Photo);
if (photo != null)
{
IRandomAccessStream stream = await photo.OpenAsync(FileAccessMode.Read);
bmp.SetSource(stream);
imageGrid.Source = bmp;
}
}
private async void saveButton_Click3(object sender, RoutedEventArgs e)
{
//Save Image to the file
//What code goes here?
}
I set the image to a grid (imageGrid) after taking the picture, so that the user can view it. After completing some tasks, I want the user to be able to press a button to save the picture and text information. I don't have a problem saving text to a file, but I can't seem to find any information on saving an image in this way. I do not want to save it directly from the camera. I need to give the user the ability to save it on command. So my question is, how do I save an captured image after setting it into the UI as a XAML Image? Thanks in advance.