Sub Globals
Dim TouchImageView1 As TouchImageView
Dim pnl As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
phon.setscreenorientation (0)
TouchImageView1.Initialize("TouchImageView1")
Activity.AddView(TouchImageView1, 0, 0, 100%x, 100%y)
TouchImageView1.Gravity=Gravity.FILL
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(Main.outdir, Main.thepic)
TouchImageView1.SetBitmap(Bitmap1)
If FirstTime Then
' Rect parameters are: left, top, right, bottom
SourceImageRect.Initialize(0, 0, Bitmap1.Width, Bitmap1.Height)
TouchImageViewRect.Initialize(0, 0, TouchImageView1.Width, TouchImageView1.Height)
End If
' put an invisible panel over the touchimageview
pnl.Initialize ("pnl")
Activity.AddView(pnl, 0, 0, 100%x, 100%y)
pnl.Color = Colors.ARGB(0, 0, 0, 0)
End Sub
Sub TouchImageView1_Click(X As Int, y As Int)
Log("Click X="&X&", Y="&y)
Dim b As Button
b.initialize ("touchbtn")
bcount=bcount+1
b.Tag=bcount
b.Text=bcount
b.color=Colors.red
' Now put the button on the panel
pnl.addview (b,x,y,40,40)
End Sub