Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How i can get the colors of a bitmap image and show them on a pallet like this :


http://www.codeproject.com/KB/Articles/686374/Working/2-120.jpg[^]
Posted

Iterate through the bitmap making a list of every pixel's colour, not forgetting to ignore duplicates. Then sort the list into whatever order you prefer, e.g. reds, greens, blues etc. Then go through the list and draw a shape in the window for each colour. See the GetPixel method[^] for further information.
 
Share this answer
 
On November 13, this year, I posted a very complete code example for analyzing all the colors in a bitmap: you could easily adapt that code to your goal: [^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900