'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim Cam As AdvancedCamera
Dim isLandscape As Boolean
Dim Ratio As Float
Dim pnlCam As Panel
Dim pnlLadder As Panel
Dim pnlDropLine As Panel
Dim imgLadder As ImageView
Dim imgDropLine As ImageView
'Dim seekMover As SeekBar
End Sub
Sub Activity_Create(FirstTime As Boolean)
If Activity.Width > Activity.Height Then
isLandscape = True
Else
isLandscape = False
End If
pnlCam.Initialize("pnlCam")
'seekMover.Initialize("seekMover")
Activity.AddView(pnlCam, 0, 0, 100%x, 100%y)
'Activity.AddView(seekMover, 10dip, Activity.Height - 50dip, Activity.Width - 20dip, 40dip)
End Sub
Sub Activity_Resume
Cam.Initialize(pnlCam, "Cam")
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Cam.Release
End Sub
Sub Cam_Ready (Success As Boolean)
If Success Then
Cam.StartPreview
Ratio = Cam.CurrentPictureSizeWidth / Cam.CurrentPictureSizeHeight
pnlCam.Height = pnlCam.Width / Ratio
Log("Aspect Ratio set to - " & Ratio)
Else
ToastMessageShow("Cannot open camera", True)
End If
End Sub