Sub Process_Globals
Private frontCamera As Boolean = False
End Sub
Sub Globals
Private Panel1 As Panel
Private camEx As CameraExClass
Dim Panel2 As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Activity.LoadLayout("1")
Panel1.Initialize("")
Panel2.Initialize("")
Activity.AddView(Panel1,0,0,100%x,100%y)
Activity.AddView(Panel2,0,0,100%x,100%y)
Panel2.Color = Colors.Red
End Sub
Sub Activity_Resume
InitializeCamera
End Sub
Private Sub InitializeCamera
camEx.Initialize(Panel1, frontCamera, Me, "Camera1")
frontCamera = camEx.Front
End Sub
Sub Activity_Pause (UserClosed As Boolean)
camEx.Release
End Sub
Sub Camera1_Ready (Success As Boolean)
If Success Then
camEx.SetJpegQuality(90)
Log(camEx.GetSupportedFlashModes) 'here check first which modes are supported
camEx.SetFlashMode("torch") 'will turn it on into torch mode
camEx.CommitParameters
camEx.StartPreview
Log(camEx.GetPreviewSize)
Else
ToastMessageShow("Cannot open camera.", True)
End If
End Sub