Android Question Path Camera Size

Croïd

Active Member
Licensed User
Longtime User
How find direct path to open the resolution & quality settings for camera ?

Or how can I display all resolutions in a panel ? (not step by step with btnPictureSize_Click)


way.png


B4X:
Sub btnPictureSize_Click
    Dim pictureSizes() As CameraSize = camEx.GetSupportedPicturesSizes
    Dim current As CameraSize = camEx.GetPictureSize
    For i = 0 To pictureSizes.Length - 1
        If pictureSizes(i).Width = current.Width And pictureSizes(i).Height = current.Height Then Exit
    Next
    Dim ps As CameraSize = pictureSizes((i + 1) Mod pictureSizes.Length)
    camEx.SetPictureSize(ps.Width, ps.Height)
    ToastMessageShow(ps.Width & "x" & ps.Height, False)
    camEx.CommitParameters   
End Sub
 
Last edited:

MaFu

Well-Known Member
Licensed User
Longtime User
Where's the problem?
Use a spinner or listview and fill it with the result from camEx.GetSupportedPicturesSizes.
On select set the choosen size.
 
Upvote 0

Croïd

Active Member
Licensed User
Longtime User
Where's the problem?
Use a spinner or listview and fill it with the result from camEx.GetSupportedPicturesSizes.
On select set the choosen size.

This ?

Dim Result As String
Result = camEx.GetSupportedPicturesSizes.Length
spinner1.Add(Result)
camEx.CommitParameters

But result is :24 and not size !
 

Attachments

  • CamSize.zip
    10.5 KB · Views: 154
Last edited:
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
"camEx.GetSupportedPicturesSizes" returns an array. And if you write "camEx.GetSupportedPicturesSizes.Length" then your result is the array length.

Create a variable in Globals:
B4X:
Dim pictureSizes() As CameraSize
and use this code:
B4X:
pictureSizes = camEx.GetSupportedPicturesSizes
For Each ps As CameraSize In pictureSizes
    spinner1.Add(ps.Width&" x "&ps.Height)
Next
and in the spinner event:
B4X:
Sub spinner1_ItemClick(Position As Int, Value As Object)
    Dim ps As CameraSize = pictureSizes(Position)
    camEx.SetPictureSize(ps.Width, ps.Height)
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Similar Threads

Top