Xamarin app that uses camera is saving photos as corrupt
Davi Moura
1
Reputation point
I have this problem, I already changed the photos to all possible formats, but nothing has changed
CS:
namespace Aluno_Digital
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CameraPage : ContentPage
{
public CameraPage()
{
InitializeComponent();
}
async void EscolherIMG(System.Object sender, System.EventArgs e)
{
var result = await MediaPicker.PickPhotoAsync(new MediaPickerOptions
{
Title = "Por favor uma imagem"
});
var stream = await result.OpenReadAsync();
resultIMG.Source = ImageSource.FromStream(() => stream);
}
async void TirarFT(System.Object sender, System.EventArgs e)
{
var result = await MediaPicker.CapturePhotoAsync();
var stream = await result.OpenReadAsync();
var image = await result.OpenReadAsync();
var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
Directory = "Fotos Tiradas",
Name = "Foto.pdf"
});
}
}
}