Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim cvs, Pancvs As Canvas
Dim Panel1 As Panel 'ImageView
Dim Arrow1, Arrow2,Arrow3 As DrawArrows
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Dim Button1 As Button
cvs.Initialize(Activity)
cvs.DrawColor(Colors.Transparent)
Panel1.Initialize("Panel1_Click")
Activity.AddView(Panel1,600,300,300,100)
Pancvs.Initialize(Panel1)
Pancvs.DrawColor(Colors.Gray)
Button1.Initialize("Button1")
Activity.AddView(Button1, 10,10,100,50)
Button1.Enabled=True
Button1.Text="Scale"
arrLength=200dip
arrWidth=20dip
arrHead=2*arrWidth
arrscale=1
OriginalSize=arrscale
x1=300dip
y1=300dip
x2=600dip
y2=400dip
Pancvs.DrawLine(600,300,800,400,Colors.white,10dip) 'this line does not appear
cvs.DrawLine(200,300,800,400,Colors.white,10dip) ' this line appears
Panel1.Invalidate
Direction="Left"
If Direction="Left" Then ArrColour=Colors.Red Else ArrColour=Colors.Green
Arrow1.Initialize(x1,y1,arrscale,arrLength,arrHead, arrWidth,Direction,ArrColour)
CallSub2(Arrow1,"DrawNewArrows",cvs)
Direction="Right"
If Direction="Left" Then ArrColour=Colors.Red Else ArrColour=Colors.Green
Arrow2.Initialize(x2,y2,arrscale,arrLength,arrHead,arrWidth,Direction, ArrColour)
CallSub2(Arrow2,"DrawNewArrows",cvs)
ArrColour=Colors.Blue
Arrow3.Initialize(600dip,300dip,arrscale,arrLength,arrHead, arrWidth,Direction,ArrColour)
CallSub2(Arrow3,"DrawNewArrows",Pancvs)
Activity.Invalidate
End Sub