I am trying to write text on canvas based on input from a edittext view
getting outofboundexception error in Exdraw.DrawText2
how to solve this :sign0085:
B4X:
Sub edittxtOK_Click
inserttext(txtinsert)
image_edit.Invalidate
bmap.Initialize3(image_edit.Bitmap)
End Sub
Sub inserttext(txt As String) As Bitmap
Dim bmpedited As Bitmap
bmpedited.InitializeMutable(bmap.width, bmap.height)
Dim c As Canvas
c.Initialize2(bmpedited)
Dim paint As ABPaint
paint.Initialize
paint.setTypeface(myfont1)
paint.SetColor(Colors.Yellow)
'
'Dim rect1 As Rect
Dim width,height As Float
width = c.MeasureStringWidth(txt,myfont1,10)
height =c.MeasureStringHeight(txt,myfont1,10)
ExDraw.drawText2(c,txt,0,width,0,0, paint)
Return bmpedited
edittxtOK.Visible=False
End Sub
getting outofboundexception error in Exdraw.DrawText2
how to solve this :sign0085: