Okay so I have 4 values(A, R, G, B) and im trying to make them into a decimal.
public function MergeABGR(A, R, G, B)
Return (A << 24) + (R << 16) + (G << 8) + B
end function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
msgbox(MergeABGR(dim a = 255, dim r = 255, dim g = 0, dim b = 255))
End Sub
The result im getting from this is: -65282.
I should be getting: 4294902015
Anyone know why this is happening??
Dim Decimal as Long = 4294902015
Dim outA as integer = SplitA(Decimal, OutA)
Dim outR as integer = SplitR(Decimal, OutR)
Dim outG as integer = SplitG(Decimal, OutG)
Dim outB as integer = SplitB(Decimal, OutB)
Public Function SplitR(ABGR, ByRef R)
R = ABGR And &HFF
Return R
End Function
Public Function SplitG(ABGR, ByRef G)
G = ABGR >> 8 And &HFF
Return G
End Function
Public Function SplitB(ABGR, ByRef B)
B = ABGR >> 16 And &HFF
Return B
End Function
Public Function SplitA(ABGR, ByRef A)
A = ABGR >> 24 And &HFF
Return A
End Function
After all this, these are the results I get outA = 255 outR = 255 outG = 0 outB = 255