I am having trouble adding 32x32x256 color icons to an image list (at
design-time). If my color-depth is higher than 256 colors, then the images
seem to go in fine, but when they are displayed on a 256 color system...
blah! If I put me development system in 800x600x256 colors then when I add
the 256 color icon to the image list, it gets fried right away. I think the
image gets reduced to 16 colors or so it seems. Does anyone have any ideas?
Thanks,
Ed Salgado
Senior Developer
TvSCAN - A Division of BuyMedia, Inc.
800-476-7226
esal...@TvScan.com
"Ed Salgado" <esal...@tvscan.com> wrote in message news:3afc60f4_1@dnews...
> I am having trouble adding 32x32x256 color icons to an image list (at
> design-time). If my color-depth is higher than 256 colors, then the
images
> seem to go in fine, but when they are displayed on a 256 color system...
That's because the system has to use those 256-colours for the entire
system's colour scheme. Once you decrease the pallete by however many
colours Windows needs to draw all the bevels, etc. that it uses, you no
longer have a full 256-colour pallete. When using high-colour (i.e. more
than 16-colours) images you should always provide a low colour version which
you can drop back to.
To find out the current amount of colours you'll need to have a look at the
Windows API GetDeviceCaps.
Damien
Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
> Those 256 colors are not real colors but indices into a palette of colors.
> Depending on which application has the focus, its palette is loaded and
> all the colors of the other applications are wrong.
> There is no gain in not using true color, except a few bytes of memory.
Thanks for the responses.
This particular system is a commercial application and someone decided
that its minimum video requirements was 800x600x256. My app looks great in
true color, but in 256 color the icons get fried. I'd like to provide a set
of icons that looks good in true color _and_ in 256 color. I figured using
the Windows standard color palette for my icons would be sufficient but its
not. Is there a way of telling Windows what color palette to use when my
app is being displayed?
Any other suggestions would be appreciated.
Thanks again,
"Ed Salgado" <esal...@tvscan.com> wrote in message
news:3afd5e8f$1_1@dnews...
> Any other suggestions would be appreciated.
There's a topic in the Win32 Programmer's Reference help file called
"Palette Messages", it has information on this subject.
P.S. Please don't sent a reply to both the newsgroup and my personal E-mail
account.
Damien
Image lists use the palette of the application even in design mode so when you change your screen color res in the development environment your image list changes so this is something to be aware of. May I suggest you use 16M color and 16 color bitmap resources and load the required one at run time depending on the screen res. I wouldn't bother with palette management at 256 colors and just use 16 colors instead.
1. The image closest in size to the requested size is chosen.
2. If two or more images of that size are present, the one that
matches the color depth of the display is chosen.
3. If none exactly match the color depth of the display, Windows
chooses the image with the greatest color depth without exceeding the
color depth of the display.
4. If all the size-matched images exceed the color depth of the
display, the one with the lowest color depth is chosen.
5. Windows treats all color depths of 8 or more bpp as equal. For
example, it is pointless to have a 16x16 256 color image and a 16x16
16bpp image in the same resource邑indows will simply choose the first
one it encounters.
6. When the display is in 8bpp mode, Windows will prefer a 16 color
icon over a 256 color icon, and will display all icons using the system
default palette.
Colin
e-mail :co...@wilsonc.demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm