Sub CreateBitmap(text As String) As B4XBitmap
Dim xui As XUI
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 32dip, 20dip)
Dim c As B4XCanvas
c.Initialize(p)
c.DrawRect(c.TargetRect, xui.Color_White, True, 0)
c.DrawText(text, c.TargetRect.CenterX, c.TargetRect.CenterY + 9dip, xui.CreateDefaultBoldFont(16), xui.Color_Black, "CENTER")
c.Invalidate
Return c.CreateBitmap
End Sub