problem loading bitmap from embeded resource :(

N

news.austin.rr.com

Hi,

I'm trying to load a bitmap resource using the following code but i keep
getting a null ref exception.

titleBar1.ModeImage = new
Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("ProjectNam
eSpace.Arrow.bmp"));

the namespace matches the default NS in the project properties.


Any Ideas?

Thanks
 
A

Alex Feinman [MVP]

Use Assembly.GetExecutingAssembly().GetManifestResourceNames to enumerate
the names of the embedded resources. I found that it is the best
troubleshooting tool in this case.
Keep in mind that the resource names are case-sensitive and the putting an
image in a subfolder makes the resource name to include folder name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top