By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,498 Members | 1,558 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,498 IT Pros & Developers. It's quick & easy.

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

P: n/a
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).
Jul 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
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).
Jul 27 '06 #2

P: n/a
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.
AMercer wrote:
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.
>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).
Jul 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.