Hello everybody,
I am a new on B4A, and i’m developing an APP whish show on the map some marker based in canvas.
My question is that i need to draw a text description on the canvas but is not working. After several time, I can show the text but not all the longitude just a part of the text.
This is my code :
Thanks you for your helo
I am a new on B4A, and i’m developing an APP whish show on the map some marker based in canvas.
My question is that i need to draw a text description on the canvas but is not working. After several time, I can show the text but not all the longitude just a part of the text.
This is my code :
B4X:
Sub CreateBitmap(text As String) As B4XBitmap
Dim xui As XUI
Dim p As B4XView = xui.CreatePanel("")
Dim Img01 As Bitmap =SetBitmapDensity(LoadBitmap(File.DirAssets,"car.png"))
Dim rect01 As B4XRect
p.SetLayoutAnimated(0, 0, 0, 50dip, 30dip)
Dim c1 As B4XCanvas
c1.Initialize(p)
rect01.Initialize(50dip,0dip,50dip,40dip)
c1.DrawRect(rect01, xui.Color_Transparent, True,3)
c1.DrawBitmap(Img01,c1.TargetRect) ' nuevo
c1.DrawText(text, c1.TargetRect.CenterX, c1.TargetRect.CenterY +2dip, xui.CreateDefaultBoldFont(15), xui.Color_Red, "LEFT")
c1.Invalidate
Return c1.CreateBitmap
End Sub
Thanks you for your helo