Bitmap.GetPixel color format

agraham

Expert
Licensed User
Longtime User
It's a 32 bit number which represents the byte values of the Alpha, Red, Green and Blue components of the colour. You can deconstruct it with
B4X:
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
and construct it from the components with the keyword ARGB(Alpha As int, R As int, G As int, B As int) As int.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Hi agraham,

How can one gets the color of a table cell in a scrollview?

Thanks
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
A table cell in a ScrollView is a Label.
So you need to get the Label view and get its color with the code you find here Get Color(of a label).
Are you filling the table ?
If yes, you should know the color you give the cell.
If you are using the Table class, you can get the colors with
- getRowColor1 for the odd rows
- getRowColor2 for the even rows
- getSelectedRowColor for a selected row
 
Upvote 0
Top