Example #1
0
        public static async Task <FotoMD> TiraFoto(string nomeFoto = "test.jpg", string dir = "myDir", bool saveInAlbum = true)
        {
            var md = new FotoMD();

            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.pathInterna = photo.Path;
            md.fotoArray   = photo.GetStream().ToByteArray();

            return(md);
        }
Example #2
0
        private async void BtnFoto_Clicked(object sender, EventArgs e)
        {
            FotoMD md = await Photo.TiraFoto();

            if (md == null)
            {
                return;
            }

            this.imgFoto.Source = md.fotoArray.ToImageSource();
            PessoaBC.FotoByte   = md.fotoArray;
        }
Example #3
0
 private void PreencheFotos(FotoMD md)
 {
     this.ImgSBanco   = md.fotoArray.ToImageSource();
     this.ImgSGaleria = md.pathGaleria;
     this.ImgSInterna = md.pathInterna;
 }