Color Detector

Jul 26, 2012 at 2:43pm
Hello!

I'm trying to build a small program that tells me the RGB values of the pixels on which my cursor is currently located at.

So far I've made this, however, I'm not sure how to continue:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <string>
using namespace std;

int main() {
  
	POINT p;
	int x;
	int y;
	string red, green, blue;

	while(0==0){
	GetCursorPos(&p);
	x = p.x;
	y = p.y;

	
	//[insert color detector here]
	cout >> red >> green >> blue;
   
	}
	_getch();
}


I did a bunch of googling as well, but I didn't find it very useful.

Any ideas?
Thanks!



Last edited on Jul 26, 2012 at 2:43pm
Jul 26, 2012 at 3:07pm
Jul 26, 2012 at 3:19pm
Sweet! Thanks!
Moved it to Windows Programming:
http://www.cplusplus.com/forum/windows/76053/
Topic archived. No new replies allowed.