Thank you for explaining. Youve been very helpful.
I know how to do what you mentioned (going through each color, etc)
Not sure having that information is worth the trouble.
Thanks, and happy computing,
> >errr... Both? Always trying to be thorough, and keeping all contingencies
> >covered. (obviously I would have to determine endusers desktop bitdepth, and
> >proceed accordingly (this in itself should be easily done)
> >I have tried several routines, using BITMAPFILEHEADER, BITMAPINFOHEADER etc
> >to extract information, however it hasnt appeared to report # of colors (in
> >8bit graphic) accurately (always says 256 or 16 in a 4 bit graphic,
> >regardless of actual number "used"). And it does not report that
> >information at all for a 24 bit graphic... ive been trying!!! :) (could any
> >of this because of my desktop bitdepth?)
> >However, it is most likely, that endusers of my game program, will be
> >running 16-24bit desktops.
> >Most gamers I know, left 256 colors behind long ago... :) So as far as
> >desktop bitdepth, I can probably count on my endusers to be 16-32bit depth
> >(I assume these are programmatically the same as 24bit... hopefully im not
> >assuming too much) (my videocard has 16bit and 32 bit, no 24 bit.. are these
> >pretty much the same overall?)
> Forget 8 bit then.
> 16 bit Desktop
> Maximum number of unique colors that can be displayed is 65,536
> 24 bit Desktop
> Maximum number of unique colors that can be displayed is 16,777,216 and
> that is the maximum number you can ever display.
> 32 bit Desktop
> Maximum number of unique colors same as for 24 bit desktop.
> The 32 bit is for speeding up color display
> For a file on disk nothing within the file will tell you how many
> _unique_ colors the image actually uses. The biBitCount value of the
> BITMAPINFOHEADER says what bit depth the file was created with, but you
> can have a 24 bit .bmp file with only one color.
> I suspect is quite common to have video cards with no 24 bit setting.
> When a bmp is loaded into a PictureBox at design time, or with
> LoadPicture, the loaded bitmap is displayed at the resolution set by the
> To count the number of unique colors in a displayed bitmap I'm afraid
> you have to work through every single color in the bitmap, and keep a
> running total of colors that only occur once. One can do this for the
> same bitmap in a file but the two answers won't necessarily be the same.
> For example a 24 bit .bmp file that has 30,121 unique colors only has
> 13,592 unique colors when displayed on a 16 bit Desktop.
> Richard Mason
(remove the "1" from email if you need to email me)