Is it possible to extract the green value (for example) of a color using only one instruction??? I tried something like this:

movzx eax,byte ptr


That did not work very well I'm afraid.

Anyone knows how to achieve this??



/Delight
Posted on 2002-06-01 08:20:10 by Delight
What you are after is a BYTE from a COLORREF DWORD size value.

The COLORREF format is 00BBGGRR in hex so try something like,


mov al, BYTE PTR The_Value[2]

See if this works.

Regards,

hutch@movsd.com
Posted on 2002-06-01 08:31:18 by hutch--
this worked for me

color db 0FFh,0EFh,012h

movzx eax,byte ptr

now eax = EF
Posted on 2002-06-01 08:37:07 by Sa6ry
I solved it :) Both versions are working just fine, but I did a mistake.

movzx eax,byte ptr

should be

movzx eax,byte ptr



Thank you Hutch and Sa6ry for your help.



/Delight
Posted on 2002-06-01 08:45:11 by Delight