Code:
#compile exe #register none sub ExtractRGB(byval rgbColor as long,Red as byte,Green as byte,Blue as byte) !mov eax,rgbColor !mov ebx,Red !mov [ebx],al !shr eax,8 !mov ebx,Green !mov [ebx],al !shr eax,8 !mov ebx,Blue !mov [ebx],al end sub function pbmain as long dim rgbColor as long dim Red as byte dim Green as byte dim Blue as byte 'Red = 10 'Green = 20 'Blue = 30 rgbColor = rgb(10,20,30) ExtractRGB rgbColor,Red,Green,Blue msgbox format$(Red,"Red = # ") & $CRLF & format$(Green,"Green = # ") & $CRLF & format$(Blue,"Blue = #") end function
Hope this helps!
------------------
Cheers!
Leave a comment: