Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Dim w As Float = Root.width
Dim h As Float = Root.Height
Dim r As Float = 40
Dim basePanel As B4XView = xui.CreatePanel("")
Dim rect As B4XRect
rect.Initialize(w / 2 - 150, h / 2 - 200, w / 2 + 150, h / 2 + 200)
Root.AddView(basePanel, rect.Left, rect.top, rect.Width, rect.Height)
cv.Initialize(basePanel)
rect.Initialize(0, 0, rect.Width, rect.Height)
cv.DrawRect(rect, xui.Color_Black, False, 2dip)
drawArc(0, 0, r, 0, 90, 1, 1)
drawArc(rect.width, 0, r, 90, 90, -1, 1)
drawArc(rect.width, rect.height, r, -90, -90, -1, -1)
drawArc(0, rect.height, r, -90, 90, 1, -1)
cv.Invalidate
End Sub
Private Sub drawArc(x As Float, y As Float, radius As Float, startSweep As Float, sweep As Float, adjX As Float, adjY As Float)
Dim path As B4XPath
path.InitializeArc(x, y, radius, startSweep, sweep)
cv.DrawPath(path, xui.Color_Black, False, 1dip)
path.Initialize(x, y)
path.LineTo(x + adjX * radius, y)
path.lineTo(x, y + adjY * radius)
cv.DrawPath(path, xui.Color_Transparent, True, 0)
End Sub