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


Code: Copy
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:
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
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

Last edited:
Upvote 0
"camEx.GetSupportedPicturesSizes" returns an array. And if you write "camEx.GetSupportedPicturesSizes.Length" then your result is the array length.

Create a variable in Globals:
Code: Copy
Dim pictureSizes() As CameraSize
and use this code:
Code: Copy
pictureSizes = camEx.GetSupportedPicturesSizes
For Each ps As CameraSize In pictureSizes
    spinner1.Add(ps.Width&" x "&ps.Height)
Next
and in the spinner event:
Code: Copy
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
Upvote 0

Similar Threads

  • Question Question
Android Question Camera picture size
Replies
2
Views
4K
Replies
8
Views
17K
Replies
62
Views
85K
  • Locked
  • Article Article
Android Tutorial Intent Based Camera
Replies
48
Views
49K
Back
Top