Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created April 28, 2018 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/b18b2dd4a5744a70c2dfe8110cfd1898 to your computer and use it in GitHub Desktop.
Save icebeam7/b18b2dd4a5744a70c2dfe8110cfd1898 to your computer and use it in GitHub Desktop.
FaceLoginApp: ServicioImagen.cs
using System;
using System.Threading.Tasks;
using Plugin.Media;
using Plugin.Media.Abstractions;
namespace FaceLoginApp.Servicios
{
public static class ServicioImagen
{
public static async Task<MediaFile> TomarFoto()
{
MediaFile foto = null;
try
{
await CrossMedia.Current.Initialize();
if (CrossMedia.Current.IsCameraAvailable || CrossMedia.Current.IsTakePhotoSupported)
{
//foto = await CrossMedia.Current.PickPhotoAsync();
foto = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
Directory = "Pictures",
Name = "emotion.jpg"
});
}
}
catch (Exception ex)
{
}
return foto;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment