A namespace can't contain whitespaces that's why you can't embed your
image into the directory with a space like "Status bar" but you can
rename it like "Status_Bar", "StatusBar" ...
Tomer wrote:
> Will it work with directories with embedded spaces, like "Status bar\Icons"?
>
> Tomer.
>
>
> "Sergey Bogdanov" <(E-Mail Removed)> wrote in message
> news:uAUzBY$(E-Mail Removed)...
>
>>Assuming that your image is placed into directory "Graphics\Icons" to
>>retrieve this image you should write something like this:
>>
>>
>
> Assembly.GetExecutingAssembly().GetManifestResourceStream("GUI.Graphics.Icon
> s.Battery1.gif");
>
>>Since you have to explicitly set the full path to the image in you
>
> assembly.
>
>>
>>Tomer wrote:
>>
>>>Hi,
>>>
>>>I've a gif in my project inside one of its directories (for example:
>>>Graphics\Icons), its is compiled as embedded resource.
>>>
>>>I can't get the gif's stream when calling the method:
>>>
>
> Assembly.GetExecutingAssembly().GetManifestResourceStream("GUI.Battery1.gif"
> );
>
>>>Where GUI is the assembly name, and Battery1.gif is the image name.
>>>
>>>This line works fine when the image is in the root of the project.
>>>
>>>How can I make it work from directories?
>>>
>>>
>>>
>>>Tomer.
>>>
>>
>>
>>--
>>Best regards,
>>Sergey Bogdanov
>
>
>
--
Best regards,
Sergey Bogdanov
|