This commit is contained in:
cvaldes1201
2023-10-09 14:56:52 -06:00
parent 02a3eb0eed
commit f84b7c0e9b
7 changed files with 145 additions and 104 deletions

View File

@@ -51,7 +51,7 @@ Private Sub FindCamera (frontCamera As Boolean) As CameraInfoAndId
Array As String("java.lang.int", "android.hardware.Camera$CameraInfo"))
r.target = cameraInfo
Log("facing: " & r.GetField("facing") & ", " & cameraValue)
If r.GetField("facing") = cameraValue Then
If r.GetField("facing") = cameraValue Then
ci.cameraInfo = r.target
ci.Id = i
Return ci
@@ -144,8 +144,8 @@ End Sub
Public Sub CommitParameters
'Try
r.target = nativeCam
r.RunMethod4("setParameters", Array As Object(parameters), Array As String("android.hardware.Camera$Parameters"))
r.target = nativeCam
r.RunMethod4("setParameters", Array As Object(parameters), Array As String("android.hardware.Camera$Parameters"))
'Catch
' ToastMessageShow("Error setting parameters.", True)
' Log(LastException)
@@ -277,24 +277,24 @@ Public Sub PreviewImageToJpeg(data() As Byte, quality As Int) As Byte()
End Sub
Public Sub GetSupportedFocusModes As List
r.target = parameters
Return r.RunMethod("getSupportedFocusModes")
r.target = parameters
Return r.RunMethod("getSupportedFocusModes")
End Sub
Public Sub SetContinuousAutoFocus
Dim modes As List = GetSupportedFocusModes
If modes.IndexOf("continuous-picture") > -1 Then
SetFocusMode("continuous-picture")
Else If modes.IndexOf("continuous-video") > -1 Then
SetFocusMode("continuous-video")
Else
Log("Continuous focus mode is not available")
End If
Dim modes As List = GetSupportedFocusModes
If modes.IndexOf("continuous-picture") > -1 Then
SetFocusMode("continuous-picture")
Else If modes.IndexOf("continuous-video") > -1 Then
SetFocusMode("continuous-video")
Else
Log("Continuous focus mode is not available")
End If
End Sub
Public Sub SetFocusMode(Mode As String)
r.target = parameters
r.RunMethod2("setFocusMode", Mode, "java.lang.String")
r.target = parameters
r.RunMethod2("setFocusMode", Mode, "java.lang.String")
End Sub
Public Sub GetFocusDistances As Float()
@@ -306,7 +306,7 @@ End Sub
Public Sub GetSupportedPictureFormats As List
r.target = parameters
Return r.RunMethod("getSupportedPictureFormats")
Return r.RunMethod("getSupportedPictureFormats")
End Sub
'This method should only be called if you need to immediately release the camera.
'For example if you need to start another application that depends on the camera.
@@ -330,23 +330,23 @@ Private Sub Camera_FocusDone (Success As Boolean)
End Sub
Public Sub IsZoomSupported As Boolean
r.target = parameters
Return r.RunMethod("isZoomSupported")
r.target = parameters
Return r.RunMethod("isZoomSupported")
End Sub
Public Sub GetMaxZoom As Int
r.target = parameters
Return r.RunMethod("getMaxZoom")
r.target = parameters
Return r.RunMethod("getMaxZoom")
End Sub
Public Sub getZoom() As Int
r.target = parameters
Return r.RunMethod("getZoom")
r.target = parameters
Return r.RunMethod("getZoom")
End Sub
Public Sub setZoom(ZoomValue As Int)
r.target = parameters
r.RunMethod2("setZoom", ZoomValue, "java.lang.int")
r.target = parameters
r.RunMethod2("setZoom", ZoomValue, "java.lang.int")
End Sub
Public Sub getExposureCompensation As Int