Icons in resource files?

  • Thread starter Thread starter Bonj
  • Start date Start date
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
 
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
 
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?
 
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
 
Back
Top