Sub Activity_Create(FirstTime As Boolean)
Dim cvs As Canvas
cvs.Initialize(Activity)
Dim circle As Path
circle.Initialize(50%x, 50%y)
Dim radius As Float = 100dip
PathAddCircle(circle, 50%x, 50%y, radius)
Dim fullScreen As Path
fullScreen.Initialize(0, 0)
fullScreen.LineTo(100%x, 0)
fullScreen.LineTo(100%x, 100%y)
fullScreen.LineTo(0, 100%y)
Dim p As Path = OpPath(fullScreen, circle, "DIFFERENCE")
cvs.ClipPath(p)
Dim dest As Rect
dest.Initialize(0, 0, 100%x, 100%y)
cvs.DrawBitmap(LoadBitmap(File.DirAssets, "b4a.png"), Null, dest)
End Sub
Sub OpPath(p1 As Path, p2 As Path, Op As String) As Path
Dim jo As JavaObject = p1
Dim success As Boolean = jo.RunMethod("op", Array(p2, Op))
Log($"Success: ${success}"$)
Return p1
End Sub
Sub PathAddCircle(path As Path, x As Float, y As Float, radius As Float)
Dim jo As JavaObject = path
jo.RunMethod("addCircle", Array(x, y, radius, "CW"))
End Sub