wct097
12-27-2002, 01:08 PM
Probably a simple question, but can anyone give me a code example of how to set the image of a picturebox? I have an image "food.gif" in the Project folder, but the IDE tells me I have to code the Image, rather than setting it through the IDE.
Using the example in the documentation, I did this:
Bitmap b = new Bitmap(Assembly.GetExecutingAssembly().GetManifest ResourceStream("MyClass.food.gif"));
picFood.Image = b;
I'm getting this error:
C:\Documents and Settings\tylerwc\My Documents\Personal\Visual c#.net\MyClass\frmMain.cs(130): The type or namespace name 'Assembly' could not be found (are you missing a using directive or an assembly reference?)
When I try to compile it.
Suggestions?
Using the example in the documentation, I did this:
Bitmap b = new Bitmap(Assembly.GetExecutingAssembly().GetManifest ResourceStream("MyClass.food.gif"));
picFood.Image = b;
I'm getting this error:
C:\Documents and Settings\tylerwc\My Documents\Personal\Visual c#.net\MyClass\frmMain.cs(130): The type or namespace name 'Assembly' could not be found (are you missing a using directive or an assembly reference?)
When I try to compile it.
Suggestions?