Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms: How to use Embedded Resources in PCL Project for Image

I have 4 Images in my Resources Directory into my Portable Project and i would like to use them directly for an ImageSource (because i need to bind it).

ImageSource myImageSource = ImageSource.FromResource("resources.image.png");

I tried this but it doesn't recognize the path. How can i use my images for an ImageSource ?

like image 572
Elykx Avatar asked Oct 19 '22 13:10

Elykx


1 Answers

Ok, my bad i forgot the name of my project before the Resources directory

ImageSource myImageSource = ImageSource.FromResource("NameOfProject.Resources.image.png");
like image 70
Elykx Avatar answered Nov 15 '22 09:11

Elykx