I want to create a special DLL that will contain only images. My application
will then load these images when it needs them. So I searched MSDN and found
this article:
http://msdn.microsoft.com/library/de...sInProject.asp
I followed the example but could not get it to work. Specifically, here's
my code:
Assembly myAssembly = Assembly.GetExecutingAssembly();
Stream myStream =
myAssembly.GetManifestResourceStream("DataObjects. test1.jpg");
Bitmap image = new Bitmap(myStream);
this.ClientSize = new Size(image.Width, image.Height);
pictureBox1.Image = image;
Notes:
- My DLL is called "DataObjects" and so is the namespace therein
- I loaded a sample image "test1.jpg" into the DLL and recompiled it
But the code fails on the 2nd line: "Stream myStream"
What am I doing wrong?
--
Robert W.
Vancouver, BC
www.mwtech.com