
Return an array of RGB when given long
Try the following:
Option Explicit
Private Declare Sub MemCopy Lib "kernel32" Alias _
"RtlMoveMemory" (ByRef Destination As Any, _
ByRef Source As Any, ByVal Bytes As Long)
Private Sub Command1_Click()
Dim p As Long, b(1 To 4) As Byte
p = Point(100, 100)
'
' convert Long to RGB
MemCopy b(1), p, 4
'
Print "Red =", b(1)
Print "Green =", b(2)
Print "Blue =", b(3)
End Sub
Mike
Quote:
> Hello,
> Is there an inverse to the RGB function. i.e. one that returns an array
> of RGB values when given a long?
> -Eric