Closed zxyao145 closed 2 years ago
What if you load it into a stream as a workaround?
I'm not sure also if you're running into some issues with how you're trying to access the file with permissions on Android.
Hi @zxyao145. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
What if you load it into a stream as a workaround?
I'm not sure also if you're running into some issues with how you're trying to access the file with permissions on Android.
I have tried to use the following code, but it still doesn't work. I'm not sure if it's a problem with my use
var stream = await photo.OpenReadAsync();
long len = stream.Length;
await DisplayAlert("len", len +"", "OK"); // I can observe that the length is greater than 0
Img.Source = ImageSource.FromStream(()=> stream);
Since I didn't find the use document of MediaPicker under the Maui document, I referred to the xamarin document, which contains the relevant permission setting instructions: https://docs.microsoft.com/en-us/xamarin/essentials/media-picker
Do other pictures load at all? We've had a bug where no image would load at all. If you load an image from a URL does that work? Or does the .NET bot from the template show?
If it doesn't show any images please wait for RC3 which should be here very soon and see if that fixes this issue.
Hi @zxyao145. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Do other pictures load at all? We've had a bug where no image would load at all. If you load an image from a URL does that work? Or does the .NET bot from the template show?
If it doesn't show any images please wait for RC3 which should be here very soon and see if that fixes this issue.
Hi, load an image from a URL does not work too. And it can only display the picture under Resources\Images
, including dotnet_bot.png
of course.
Waiting for your fixes , thanks a lot!
@zxyao145 RC3 has been released just now which should make it all work again! Could you update and let us know? :)
Hi @zxyao145. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@zxyao145 RC3 has been released just now which should make it all work again! Could you update and let us know? :)
Perfect! In RC3, it works as expected. And I think this issue can be closed. Thank you!
Description
Image cannot display device picture which in "/data/user/0/app/cache/xxx.png", it's display as blank.
And my code as follow:
MainPage.xaml:
MainPage.xaml.cs
AndroidManifest.xml
BTW, is there any way to pick images from gallery?
Steps to Reproduce
MainPage
ansAndroidManifest
with the codeVersion with bug
Release Candidate 1
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
API 30
Did you find any workaround?
Affected platforms
: Only tried on AndroidRelevant log output