Icons in resource files?

B

Bonj

Hi
I figured out how to compile an icon into a resource file in C# (althougth
the output .resources file is smaller than the .ico file ...) by using csc
/resource:iconres.resources
and it seems to be OK
How do I read the icon from the resource though in the application?
It seems I need a ResourceReader class with a Stream, but how do I go about
getting a stream to read the resource section of the application?

Thanks in advance
 
M

Mattias Sjögren

How do I read the icon from the resource though in the application?
It seems I need a ResourceReader class with a Stream, but how do I go about
getting a stream to read the resource section of the application?

Assembly.GetManifestResourceStream()



Mattias
 
G

Guest

Great, I'll try it thanks

Is it right that the .resources file is smaller than the actual .ico file itself? I.e. it does still 'contain' it?
 
M

Mattias Sjögren

Is it right that the .resources file is smaller than the actual .ico file itself? I.e. it does still 'contain' it?

I don't know, it does sound a bit strange. I don't remember how the
ICO file format is laid out and if there's something that can be left
out when the .resrouces file is created. Try it and see if it works.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top