Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Pane1 As Pane
Public cnvs As B4XCanvas
End Sub
Public Sub Initialize
B4XPages.GetManager.LogEvents = True
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
cnvs.Initialize(Pane1)
Dim rect As B4XRect
rect.Initialize(0,0,300,300)
cnvs.DrawRect(rect,xui.Color_Black,True,1)
Pane1.As(B4XView).SendToBack
End Sub
Private Sub Button1_Click
Dim rect As B4XRect
rect.Initialize(0,0,200,200)
cnvs.ClearRect(rect)
Pane1.As(B4XView).BringToFront
cnvs.DrawCircle(100,100,50,xui.Color_Red,False,5)
End Sub