Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 1429

How to use NSImage.ImageNamed()?

$
0
0

I'm trying to use NSImage.ImageNamed() to change the image on a NSImageView, using:

img.Image = NSImage.ImageNamed("Image-128");

but the result is always null. The image itself is in the project in \Resources\Images\Image-128.png. I've tried specifying the complete file name, and complete path, with no luck. I've also tried setting the images build action to 'BundleResource' with no luck.

What's the correct way to go about this?

Cheers :)


Viewing all articles
Browse latest Browse all 1429