B4A Library [B4X] [XUI] AS Tab Menu - sizing of icons

in the following example code from the main thread, where does the 30 (size of rendered font bitmap) comes from?
B4X:
ASTabMenu_horizontal.AddTab(xui.Color_ARGB(255,39, 174, 97),"",ASTabMenu_horizontal.FontToBitmap(Chr(0xF015),False,30,xui.Color_White),"")
height in the layout are expressed in dip, while for fonts are not
how do you make sure your icon is at the correct size, on different density displays?
 

Alexander Stolte

Expert
Licensed User
Longtime User
where does the 30 (size of rendered font bitmap) comes from?
because this was the perfect size on my device. The finished image is adjusted to the size of the imageview anyway.
how do you make sure your icon is at the correct size, on different density displays?
just trying, i dont have a tablet to test.
 

Alexander Stolte

Expert
Licensed User
Longtime User
here is the function:
 

TILogistic

Expert
Licensed User
Longtime User
see:


B4X:
Sub SetBitmapDensity(b As Bitmap) As Bitmap
    Dim jo As JavaObject = b
    Dim den As Int = Density * 160
    jo.RunMethod("setDensity", Array(den))
    Return b
End Sub
 
Top