Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Button1 As Button
Private Label1 As Label
Private Button2 As Button
Dim cvs1 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")
cvs1.Initialize(Label1)
End Sub
Private Sub Button1_Click
For i = 1 To 100
cvs1.DrawLine(0, Label1.Height - 5,(Label1.Width/100) * i, Label1.Height - 5, Colors.Red, 5dip)
cvs1.Invalidate
Sleep(10)
Next
End Sub
Private Sub Button2_Click
Dim rect1 As B4XRect
rect1.Initialize(0,Label1.Height - 10,Label1.Width,Label1.Height)
cvs1.ClearRect(rect1)
cvs1.Invalidate
End Sub