VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Count Colors In Pic (Final update 15 June 06)

by CptnVic (6 Submissions)
Category: Graphics
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

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)
Code Returns
Unique colors in said picture
API Declarations
GetDIBits
GetTickCount

Rate Count Colors In Pic (Final update 15 June 06)

Download Count Colors In Pic (Final update 15 June 06)

Download Count Colors In Pic (Final update 15 June 06) (6 KB)

Count Colors In Pic (Final update 15 June 06) Comments

No comments have been posted about Count Colors In Pic (Final update 15 June 06). Why not be the first to post a comment about Count Colors In Pic (Final update 15 June 06).

Post your comment

Subject:
Message:
0/1000 characters