-
Pixel Values [Resolved]
Howdy all,
I know this is the C/C++ forum, but the Assembly forum is pretty much dead. I'm wanting to know what the following code would be in ASM (MASM really):
Code:
#define GetRValue(rgb) ((BYTE)(rgb))
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))
I'm wanting to retrieve the Red Green and Blue values of a picture on a DC.
Any help would be great.
Phreak
-
Well, as it turns out, ALOT of experimenting helps. I figured it out myself, and in case anyone wondered, heres what I have.
Code:
invoke GetPixel,hDC,0,0
; RED
and eax,00FF0000h
shr eax,16
; BLUE
and eax,00FF0000h
; GREEN
and eax,0000FF00h
If you look at it, its nearly the opposite to the C code (but it gets results!). I'm shifting the red value, instead of the blue value, and the green value isn't shifted at all.
Anyway, it's working now.
Phreak