Android Question Parameters for drawline in a function using dip

CRoberts

Member
Licensed User
Longtime User
Hi,

I'm trying to use drawLine with parameters

Hard coded I would write
Canvas1.DrawLine(1688dip,977dip,1601dip,977dip,Colors.Red, 5dip)
The parameters are integer with the modifier dip

how do I do this in a function ?

the following gives a Numberformatexception
Sub f_draw_line(Canvas1 As Canvas, x1 As Int, y1 As Int, x2 As Int, y2 As Int)
Dim ls_1, ls_2, ls_3, ls_4 As String
ls_1=x1 & "dip"
ls_2=y1 & "dip"
ls_3=x2 & "dip"
ls_4=y2 & "dip"

Canvas1.DrawLine(ls_1,ls_2,ls_3,ls_4,Colors.Red, 5dip)
End Sub

and using
Canvas1.DrawLine(x1,y1,x2,y2,Colors.Red, 5dip)

puts it in the wrong place.

Whats is the correct solution? Thanks
 
Top