• Advertisement
Sign in to follow this  

[.net] GetManifestResourceStream........

This topic is 4592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi this is a summary of the problem i have.Lets say that the project is called Console1 and I need to load a .jpg that i keep in the data directory but it seems that i only get a null reference to my backgroundBitmap...
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
			Bitmap backgroundBitmap = new Bitmap(asm.GetManifestResourceStream("console1.data.LevelBack.jpg"));



Could you tell me what's wrong .I'm more a C++ fan so C# is kind of new to me . Thanks a lot !

Share this post


Link to post
Share on other sites
Advertisement
Three things to look out for:
1) Did you add the image to the project using the Solution Explorer?
2) Did you change the "Build Action" property for the image file to "Embedded Resource"?
3) Did you use the exact spelling and character case for the project's namespace and the file, folder and extension of the resource file?


Detailed instructions and sample code from Microsoft Knowledge Base can be found here:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;319292

Bob

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement