Howdy all,
Ok, I might aswell try asking here. I've posted in the C/C++ forum because I don't believe many people come to this Assembly forum, but here goes.
I'm wanting to get the Red Green and Blue values of a pixel. I'm wanting something like these in Assembly (MASM, but any other is fine aswell).
Code://C++ Version
#define GetRValue(rgb) ((BYTE)(rgb))
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))
VB Code:
'VB Version Function GetRedVal(val As Long) As Long GetRedVal = val& Mod 256 End Function Function GetGreenVal(val As Long) As Long GetGreenVal = ((val And &HFF00) / 256&) Mod 256& End Function Function GetBlueVal(val As Long) As Long GetBlueVal = (val And &HFF0000) / 65536 End Function
Any help is greatly appreciated.
Thanks in advance,
Phreak
