Date: 03-28-2012
Return to Index
created by gbSnippets
'Credit: Paul Dixon
'Compilable Example:
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
#Include "Win32API.inc"
Global hDlg As Dword
Macro SwapColor(colour) 'colour is assumed to be a LONG or DWORD
!mov eax,colour 'get colour into a register
!bswap eax 'swap the bytes so 1234 -> 4321
!ror eax,8 'rotate by 1 byte so 4321 -> 1432 as required
!mov colour,eax 'write the result back
End Macro
Function PBMain() As Long
Local iColor As Long
iColor = &H112233 '11,22,33 are RGB values
MsgBox Hex$(iColor)
SwapColor(iColor)
MsgBox Hex$(iColor)
End Function
'gbs_00864
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm