Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Unable to load image after pick an image from gallery #572

Open
marthinch opened this issue Jun 19, 2018 · 3 comments
Open

Unable to load image after pick an image from gallery #572

marthinch opened this issue Jun 19, 2018 · 3 comments

Comments

@marthinch
Copy link

Does the plugin work on nougat (7.1) in xamarin form? I've already tried to render image after picking from gallery, but it didn't work to load the image.

here's my sample code :

XAML

 <Image x:Name="IdentityImage"/>
 <Button x:Name="Browse" Text="Browse" Clicked="Browse_Clicked"/>

C#

private async void Browse_Clicked(object sender, EventArgs e)
        {
            await CrossMedia.Current.Initialize();
            if (!CrossMedia.Current.IsPickPhotoSupported)
            {
                await DisplayAlert("Warning", "Pick Photo Not Available.", "OK");
                return;
            }
            _mediafile = await CrossMedia.Current.PickPhotoAsync();
            if (_mediafile == null)
                return;
            IdentityImage.Source = ImageSource.FromStream(() =>
            {
                var stream = _mediafile.GetStream();
                return stream;
            });
        }

Anyone can help me to solve this? Thanks.

@Vladis466
Copy link

May be duplicate of issue #545

@marthinch
Copy link
Author

Anyone use this plugin in nougat version?

@jamesmontemagno
Copy link
Owner

All works fine for me if you set up everything correct.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants