Sub coverpanel_Touch (Action As Int, X As Float, Y As Float) As Boolean 'Return True to consume the event
If getcolor(bmp.GetPixel(x,y )) then ...
end sub
Sub getcolor(clr As Int) As Boolean
Dim argb() As Int
argb = GetARGB(clr)
' For black :
If argb(1) < 2 AND _
argb(2) < 2 AND _
argb(3) < 2 Then Return True Else Return False
End Sub
Sub GetARGB(Color As Int) As Int()
Dim res(4) As Int
res(0) = Bit.UnsignedShiftRight(Bit.AND(Color, 0xff000000), 24)
res(1) = Bit.UnsignedShiftRight(Bit.AND(Color, 0xff0000), 16)
res(2) = Bit.UnsignedShiftRight(Bit.AND(Color, 0xff00), 8)
res(3) = Bit.AND(Color, 0xff)
Return res
End Sub