Troudeloup
asked on
code specifc; byte into int
HDC hWindowDC = ::GetDC(hWnd);
(?) COLORREF GetPixel( HDC hWindowDC, int x, int y );
I have problem with the (?) part.
what type of variable do I use to store data from getpixel?
also, how do I convert those values into
int red
int green
int blue
?
(?) COLORREF GetPixel( HDC hWindowDC, int x, int y );
I have problem with the (?) part.
what type of variable do I use to store data from getpixel?
also, how do I convert those values into
int red
int green
int blue
?
COLORREF is a 32-bit value
ASKER
ok so I do
COLORREF pixel_color = GetPixel( HDC hWindowDC, int x, int y );
and then
uh i never did this conversion before,
how do I do it?
COLORREF pixel_color = GetPixel( HDC hWindowDC, int x, int y );
and then
uh i never did this conversion before,
how do I do it?
you can use as COLORREF color = GetPixel(......)
if you want to know independent color GetRValue(), GetGValue() and GetBValue() as
COLORREF color = GetPixel(someHDC, 50, 50); // just an example
int blue = GetBValue(color);
More help here:
http://msdn2.microsoft.com/en-us/library/aa923096.aspx
if you want to know independent color GetRValue(), GetGValue() and GetBValue() as
COLORREF color = GetPixel(someHDC, 50, 50); // just an example
int blue = GetBValue(color);
More help here:
http://msdn2.microsoft.com/en-us/library/aa923096.aspx
ASKER
int blue = GetBValue(color);
got it
how do you pro guys find all of these information? it would be crazy if i think you are born with it.
got it
how do you pro guys find all of these information? it would be crazy if i think you are born with it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.