|
-
June 6th, 2002, 09:00 PM
#1
Embedded Resources
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?
-
June 6th, 2002, 09:23 PM
#2
Bitmap bmap= new Bitmap(typeof(Form1),"animage.gif");
-
June 7th, 2002, 12:09 PM
#3
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?
-
June 8th, 2002, 09:36 AM
#4
Something like this:
Code:
Stream stream = this.GetType().Assembly.GetManifestResourceStream( "Namespace.resources" );
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|