Android Question Which is the correlation in x,y coordinates


Active Member
Licensed User
Longtime User
Hello , I am using the drawarc and drawText subs in activity and the dim in globals.

Dim csvArc as canvas
Dim mion1 As Float : mion1=35
Dim ChrPoint As String : ChrPoint="."


Which is the correlation in x,y coordinates on DrawArc,DrawText,DrawPie , because as you see if i put in 125,130 in DrawText instead of 44,54 the "." will not be exactly at the arc.

The purpose is to use the arc as volume meter , and the above subs are as a try for the maximum level of volume meter corresponding for 279+35 angle.

The DrawArc an DrawPie are for the forum as follows :

Sub DrawArc(cnvs As Canvas, x As Float, y As Float, radius As Float, startAngle As Float, endAngle As Float, Color As Int,Fill As Boolean)
Dim s As Float
s = startAngle
startAngle = 180 - endAngle
endAngle = 180 - s
If startAngle >= endAngle Then endAngle = endAngle + 360
Dim p As Path
p.Initialize(x, y)
For i = startAngle To endAngle Step 10
p.LineTo(x + 2 * radius * SinD(i), y + 2 * radius * CosD(i))
p.LineTo(x + 2 * radius * SinD(endAngle), y + 2 * radius * CosD(endAngle))
p.LineTo(x, y)
cnvs.ClipPath(p) 'We are limiting the drawings to the required slice
cnvs.DrawCircle(x, y, radius, Color, Fill, 0)
End Sub

Sub DrawPie(cvs As Canvas, x As Float, y As Float, a1 As Float, a2 As Float, r1 As Float, r2 As Float, col As Int, Fill As Boolean, Stroke As Float)
Dim p As Path
Dim a, stp As Float

If a2 < a1 Then
stp = -1
stp = 1
End If

p.Initialize(x + r1 * CosD(a1), y - r1 * SinD(a1))
p.LineTo(x + r2 * CosD(a1), y - r2 * SinD(a1))
For a = a1 + 1 To a2 Step stp
p.LineTo(x + r2 * CosD(a), y - r2 * SinD(a))
p.LineTo(x + r1 * CosD(a2), y - r1 * SinD(a2))
For a = a2 + 1 To a1 Step -stp
p.LineTo(x + r1 * CosD(a), y - r1 * SinD(a))
cvs.DrawPath(p, col, Fill, Stroke)
End Sub

Many thanks Enthousiastic