I’m trying to reference a png file in my code. In the Solution Explorer in Visual Studio I added the item to a folder called “Content” which is in the default “MonoGameWindowsApplication1” folder.
I’ve tried:
Texture2D background = Content.Load<Texture2D>("background");
and
Texture2D background = Content.Load<Texture2D>("Content/background");
but they both come back as null. How can I get a reference to the image?
Here’s a screenshot of Visual Studio if that helps: https://i.stack.imgur.com/nj86s.jpg
A solution that looks to be related to your problem can be found here. You need to change
Content/backgroundto a 24 or 32 bit color format.