public static async Task <Foto_MD> TiraFoto(string nomeFoto = "test.jpg", string dir = "myDir", bool saveInAlbum = true) { var md = new Foto_MD(); var photo = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions() { Name = nomeFoto, Directory = dir, SaveToAlbum = saveInAlbum, CompressionQuality = 10, PhotoSize = Plugin.Media.Abstractions.PhotoSize.Small, CustomPhotoSize = 10, }); if (photo == null) { return(null); } md.PathGaleria = photo.AlbumPath; md.PathInterno = photo.Path; md.fotoArray = photo.GetStream().ToByteArray(); return(md); }
private async void BtnFoto_Clicked(object sender, EventArgs e) { Foto_MD md = await Photo.TiraFoto(); if (md == null) { return; } this.imgFoto.Source = md.fotoArray.ToImageSource(); PessoaBC.FotoByte = md.fotoArray; }
private void PreencheFotos(Foto_MD md) { this.ImgSBanco = md.fotoArray.ToImageSource(); this.ImgSGaleria = md.PathGaleria; this.ImgSInterna = md.PathInterno; }