I am working with xamarin.forms and using this code to get an image from user gallery
protected async Task PickImage()
{
try
{
Stream stream = await DependencyService.Get<IPicturePicker>().GetImageStreamAsync();
//stream.GetType<Uri>();
if (stream != null)
{
Image image = new Image
{
Source = ImageSource.FromStream(() => stream),
BackgroundColor = Color.Gray
};
cadastrar_foto_perfil.Source = ImageSource.FromStream(() => stream);
}
if (Device.OS == TargetPlatform.iOS)
{
loginPage.RecriaCadastroIOS();
}
}
but...Now I am getting it am putting in an Image, now I need to get the URI from the selected image...does someone know how I can do this using that code?