Forum Xamarin.Forms

Internal store Image File not access in Android in Xamarin.Forms

i successfully store image to Internal storage but In Android i can not Display Image from Internal storage,

My Code For storage in Android:
public void SavePictureToDisk"ProfilePicture", byte[] imageData) { var pictures = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); string filePath = System.IO.Path.Combine(pictures, "ProfilePicture"+".png"); try { System.IO.File.WriteAllBytes(filePath, imageData); File fl = new File(filePath); } catch (System.Exception e) { System.Console.WriteLine(e.ToString()); } }
I successfully store image to internal storage in Android.
My Code to access file stored in Xamarin.Forms
public async void ImageDisplay() { IFolder rootFolder = FileSystem.Current.LocalStorage; IFile imgfile1 = await rootFolder.GetFileAsync("ProfilePicture.png"); ImgUser.Source = ImageSource.FromFile(imgfile1.Path); }
But image Display blank.please help me.i have tried lot of but i don't get anything.
Thanx in advance.

Sign In or Register to comment.