In visualstudio, I add background.bmp to my project. I set the Build Action on the Properties page to "Embedded Resource". Now how do I use that embedded resource in the program?
Printable View
In visualstudio, I add background.bmp to my project. I set the Build Action on the Properties page to "Embedded Resource". Now how do I use that embedded resource in the program?
Bitmap bmap= new Bitmap(typeof(Form1),"animage.gif");
I don't understand that at all, but it works...
How about another example.
I have a file that I load up with several serialized objects. I open it like this:
Stream r = File.Open("resources", FileMode.Open, FileAccess.Read);
How would I open it if I embedded it?
Something like this:
Code:Stream stream = this.GetType().Assembly.GetManifestResourceStream( "Namespace.resources" );