Get embedded bitmap

G

Giuseppe

Hi all,
I have a bitmap "myImage.bmp" embedded in my project and Build Action
property is set to "Embedded Resource".
I'd like to load this image at run time with

Dim b as Bitmap
b=New
Bitmap(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream("mainSpace.myImage.bmp"))
where "mainSpace" is the namespace.

I use VS 2003 with Wince4.1 emulator and raise a "nullReference Exception".
What is wrong?

Thank you for your help

Giuseppe
 
D

Daniel Moth

1. Check the spelling especially the case (sensitive)
2. Break the line down into smaller lines and step into to see exactly where
the exception gets thrown
3. Use GetManifestResourceNames to see the exact names of what is embedded
in the assembly

Cheers
Daniel
 
G

Giuseppe

Daniel Moth said:
1. Check the spelling especially the case (sensitive)
2. Break the line down into smaller lines and step into to see exactly
where the exception gets thrown
3. Use GetManifestResourceNames to see the exact names of what is embedded
in the assembly

Cheers
Daniel

Great!, it was a NameSpace Error...

Thank you Daniel

Giuseppe
 

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