Created
April 28, 2018 14:22
-
-
Save icebeam7/b18b2dd4a5744a70c2dfe8110cfd1898 to your computer and use it in GitHub Desktop.
FaceLoginApp: ServicioImagen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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