I have a path problem with UIImage.FromFile()
method. My solution folder has 3 projects and the main UI project has an Images
folder in it. I put all my project images in this folder and I have code like this:
UIImage myImg = UIImage.FromFile("Images/someImage.png");
I have already examined this and all these topics..
I set images property of build to "content" and etc..
Can you help me:
Generally, if you have right clicked on the file, gone to it's properties and marked it as Content
then the following will work:
UIImage myImg = UIImage.FromFile(@"Images/someImage.png");
The very first question you linked to has the solution - you need to use Unix style paths ("/"), not DOS/Windows paths ("\").
You should also carefully check the casing of your paths - the emulator is more forgiving of incorrect case than the actual device is.
Finally, look inside of your .app bundle to verify that the image files are really where you think they are, relative to the root of the bundle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With