This commit is contained in:
cvaldes1201
2024-02-26 11:04:45 -06:00
parent b17f87b4c0
commit 54e33a93fd
15 changed files with 297 additions and 221 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 'ignore
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