Sub Globals
Dim ExtDrawing As ABExtDrawing
Dim cvsMain As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
cvsMain.Initialize(Activity)
End Sub
Sub Activity_Resume
DrawCircleArc(150dip, 100dip, 20dip, 0, 180, Colors.Red, False, 3, True)
DrawCircleArc(150dip, 150dip, 20dip, 90, 180, Colors.Blue, False, 3, False)
DrawCircleArc(150dip, 200dip, 20dip, 0, -180, Colors.Green, True, 3, True)
DrawCircleArc(120dip, 250dip, 20dip, 0, -235, Colors.Green, False, 3, False)
DrawCircleArc(180dip, 250dip, 20dip, 0, -235, Colors.Green, False, 3, True)
DrawCircleArc(120dip, 300dip, 20dip, 0, -235, Colors.Green, True, 3, False)
DrawCircleArc(180dip, 300dip, 20dip, 0, -235, Colors.Green, True, 3, True)
End Sub
Sub DrawCircleArc(cx As Float, cy As Float, Radius As Float, StartAngle As Float, SweepAngle As Float, col As Int, Filled As Boolean, StrokeWidth As Float, UseCenter As Boolean)
Dim r As ABRectF
r.Initialize(cx - Radius, cy - Radius, cx + Radius, cy + Radius)
Dim paint As ABPaint
paint.Initialize
If Filled = True Then
paint.SetStyle(paint.Style_FILL)
Else
paint.SetStyle(paint.Style_STROKE)
End If
paint.SetColor(col)
paint.SetStrokeWidth(StrokeWidth)
ExtDrawing.drawArc(cvsMain, r, StartAngle, SweepAngle, UseCenter, paint)
End Sub