[Mono-osx] NSImage.ImageNamed - in folder?

thenextman rmarkiewicz at devolutions.net
Thu Dec 6 19:53:01 UTC 2012


Possible stupid question - how can I load an image from a folder?

Project structure:

Clarus.gif
Images (dir)
    ClarusInFolder.gif

Code:

NSImage image1 = NSImage.ImageNamed("Clarus.gif");
Console.WriteLine(image1 == null); // Prints false

NSImage image2 = NSImage.ImageNamed("ClarusInFolder.gif");
Console.WriteLine(image2 == null); // Prints true

How can I make the second image work? I've tried to specify the folder in
the path, everything... Both images have build action set to 'Content', and
if I peek inside the bundle I can see the folder structure recreated in
there.

Thanks in advance!



--
View this message in context: http://mono.1490590.n4.nabble.com/NSImage-ImageNamed-in-folder-tp4657676.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list