
Signature
____________________________
Carlos Sosa Albert
That's because you're asking for the resource from the executing assembly.
The executing assembly is NOT your dll. It's the program that is calling
your dll. From within your dll you should be able to access your resource
directly by name without the Assembly.* stuff. So to use your example you
can call myResources.myImage directly. It will return it as a byte array,
but at that point it's trivial to create a MemoryStream object that
references it.

Signature
Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com
> Hello guys,
>
[quoted text clipped - 16 lines]
>
> Thanks.
Carlos Sosa Albert - 30 Oct 2007 14:50 GMT
Thanks for your reply, Andrew!
I can get to the bitmap using myAssembly.myResources.myImage as a
System.Drawing.Bitmap
But that's all I can get... I didn't find a way to get the byte[], and much
less a stream out of it...

Signature
____________________________
Carlos Sosa Albert
> That's because you're asking for the resource from the executing assembly.
> The executing assembly is NOT your dll. It's the program that is calling
[quoted text clipped - 24 lines]
> >
> > Thanks.
Carlos Sosa Albert - 30 Oct 2007 15:01 GMT
I found it. You pointed me in the right direction mentioning MemoryStream,
and now it works:
Stream imgStream = new MemoryStream();
MyResources.MyImage.Save(imgStream, System.Drawing.Imaging.ImageFormat.Gif);
Thanks a lot!

Signature
____________________________
Carlos Sosa Albert
> That's because you're asking for the resource from the executing assembly.
> The executing assembly is NOT your dll. It's the program that is calling
[quoted text clipped - 24 lines]
> >
> > Thanks.