multiple program icons problem - VS converts some 32bit icons to24bit

S

SharpCoderMP

i'm trying to embed multiple program icons in my executable. the only
way so far i managed to do that is to embed native win32 resource file
with multiple icons. it works, but... when i create a native win32
resource file with the VS 2005 and put there my icons, VS always
converts some of the 32bit icons into 24bit - so i loose alpha blending
what makes my icons look ugly.

I did an experiment and created a icon file with full range of icon
sizes and color depths. all from 4bit through 8bit, 24bit to 32bit and
with all standard sizes from 16x16 to 64x64. i thought that maybe the
icon is converted because it does not have one of the required
versions... that did not help. after importing icon file to the win32
res file 32x32 32bit icon was converted to 24bit despite the file
already contained the 32x32 24bit version of that icon.

so my question is how can i put icon files into win32 res file and
prevent VS from converting them from 32bit to 24bit? or maybe there is
some other way to embed multiple program icons into my executable?

to create the win32 native resource file i use VS 2005 Native resource
template (File -> New -> File -> General -> Native Resource Template).
 
G

Guest

I don't know if this will solve your problem about 32 to 24 bits, but I do
multiple icons differently. I add each .ico file to the project (Project,
Add Existing Item), and set each Build Action to Embedded Resource. The
icons are added to the exe at build time. At runtime, I can change the icon
of form(s) by creating an Icon object from the running assembly and assigning
it to the form(s) I want. During these evolutions, I don't make a win32
resource file - my starting point is several .ico files. I use simple minded
766 byte .ico files, so I don't know if the above procedure will work for
your icons. My guess is that it will work ok.
 
S

SharpCoderMP

that's not the solution for me. i do not need these icons inside my
application. they are there for users, for shortcuts or associated files
icons so i could avoid distributing separate icon files with my app.
 

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