SwapLowBytes
Result = SwapLowBytes(Value)
 
Parameters:

    Value = The value whose two least significant bytes you want to swap
Returns:

    Result
 

     SwapLowBytes splits the lower 16 bits of a value into two bytes and changes their order, while the higher 16 bits are replicated.


FACTS:


     * See SwapByteOrder for more details

     * You could also use the colour functions separate and pack an integer (See ARGB)



Mini Tutorial:


Showing the effect of SwapLowBytes

  
; Show the binary representation of the value 42,000
  Print Bin$(42000)
  
; show the binary representation of this value after using SwapLowBytes
  Print Bin$(SwapLowBytes(42000))
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would output.

  
  %00000000000000001010010000010000
  %00000000000000000001000010100100
  


 
Related Info: ARGB | SwapByteOrder | SwapWordOrder :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com