
Update 15 June 2006: (Thanks to Robert Rayment and Cobein for ideas/code!) This final (as far as I'm concerned) version now uses the GetDIBits API color stream to count the unique colors in a picture Very Quickly.
Tested in XP and Me... Not 95/98/NT yet (but should work). Masking colors returned in the GetDIBits array should resolve the OS problems that would otherwise occur.
In XP tests, three of these functions will counts a 1024x768 pic with 145,350 colors in +-.125 seconds and the 4th in +- .203 seconds... and that's not bad (Tests were compiled)!
This version includes 4 different functions for quickly counting unique colors. 2 are my work and 2 are modified from Rayment's code.
Inputs
A picture for the picture box
Assumes
Moderators:
(I see the screen shot was missing...
This upload just to replace the screen shot)
Returns
Unique colors in said picture
API DeclarationsGetDIBits
GetTickCount