Color Picker is a simple application that retrieves the color codes from any area of your desktop (including any running applications).
The program can copy that code - by pressing the SPACE key - to clipboard either in
Hex (0x...) or in HTML compatible color code (#...).
The color is shown even if the program has lost focus, but you can't copy the value to clipboard.
You can choose if you want the application's window to be modal (stay on top) or not.
Initially I make the window modal. In
I use a timer to refresh the color code of the current pixel pointed by the mouse pointer.
To retrieve the color code of any pixel on the screen we must get the device context of the entire screen.
We can make that with:
hDC = CreateDC("DISPLAY",0,0,0);
function creates a device context (DC) for a device by using it's name.
After we take the handle to the device context of the entire display, we can get the position of the cursor.
And finally we can get the color code of that point!
color = GetPixel(hDC,point.x,point.y);
After that we can release the device context:
This application is useful for web designers and programmers, too. I needed this application for designing the colors of my controls.