problem loading bitmap from embeded resource :(

  • Thread starter Thread starter news.austin.rr.com
  • Start date Start date
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
 
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
 
Back
Top