[blue]Option Explicit
' Declaration order of bytes important because of how a long is held in PC memory
Private Type ARGB
Blue As Byte
Green As Byte
Red As Byte
Alpha As Byte
End Type
Private Type udtLong
l As Long
End Type
Public Sub example()
Dim Filter As ARGB
Dim WIAFilter As udtLong
' Convert an ARGB long into component parts
WIAFilter.l = &HFF001234
LSet Filter = WIAFilter
MsgBox "Alpha: " & Filter.Alpha & " Red: " & Filter.Red & " Green: " & Filter.Green & " Blue: " & Filter.Blue
'Convert component parts into ARGB long
With Filter
.Alpha = 17
.Red = 127
.Green = 37
.Blue = 100
End With
LSet WIAFilter = Filter
MsgBox "ARGB: " & Hex(WIAFilter.l)
End Sub
[/blue]