Public Sub TextToBitmap (s As String, IsMaterialIcons As Boolean, FontSize As Float, color As Int) As Bitmap
Dim bmp As Bitmap
bmp.InitializeMutable(32dip, 32dip)
Dim cvs As Canvas
cvs.Initialize2(bmp)
Dim h As Double
If IsMaterialIcons Then
h = cvs.MeasureStringHeight(s, Typeface.MATERIALICONS, FontSize)
cvs.DrawText(s, bmp.Width / 2, bmp.Height / 2 + h / 2, Typeface.MATERIALICONS, FontSize, color, "CENTER")
Else
h = cvs.MeasureStringHeight(s, Typeface.FONTAWESOME, FontSize)
cvs.DrawText(s, bmp.Width / 2, bmp.Height / 2 + h / 2, Typeface.FONTAWESOME, FontSize, color, "CENTER")
End If
Return bmp
End Sub