If you are using VS then the picture.jpg needs to be part of the project. It
should appear in the project as an embedded resource. If it is in a
sub-directory, then sub-directories act as namespaces for embedded resources and
so your stream might be named incorrectly in the assembly manifest. A quick
ILDasm of your assembly and looking at the manifest portion will show all of
your embedded resources.
If you are trying to include the item in a normal csc command line compilation
then look at the /resource: option.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers
"Bardo" <an*******@disc ussions.microso ft.com> wrote in message
news:74******** *************** ***********@mic rosoft.com...
I am trying to show a picture in a form but using visual studios C# I am
getting a error everytime I want to deploy my program. I cannot find the reason.
Assembly assembly = Assembly.GetExe cutingAssembly( );
Image image =
Image.FromStrea m(assembly.GetM anifestResource Stream("picture .jpg"));
the debugger holds on the second line and tells me that he has no valid value
for the stream. So my understanding is that he cannot find the file picture.jpg. I have been trying all kinds of different things to get the file picture.jpg
embedded in the programma but I have no luck. Can someone be so kind to help me out with this ?
Thanks Bardo