lepton
lepton

Reputation: 714

How to set Image.Source to a photo from internal storage Pictures folder?

Here's what I have so far:

var file = Android.OS.Environment.DirectoryPictures + "/test1.jpg";
ImagePhoto.Source = ImageSource.FromFile(file);

However, no image is being set. I've double checked that the test1.jpg file exists in the device's local storage Pictures folder, and it's there when I navigate to it using File Commander. Can anyone help?

Upvotes: 1

Views: 298

Answers (1)

lepton
lepton

Reputation: 714

I managed to solve this using the Environment variables:

var file = Android.OS.Environment.ExternalStorageDirectory + "/" + Android.OS.Environment.DirectoryPictures + "/test1.jpg";

Upvotes: 1

Related Questions