Android Question Path Camera Size

Discussion in 'Android Questions' started by Croïd, Jul 12, 2015.

  1. Croïd

    Croïd Active Member Licensed 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:
    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 + 1Mod pictureSizes.Length)
        camEx.SetPictureSize(ps.Width, ps.Height)
        
    ToastMessageShow(ps.Width & "x" & ps.Height, False)
        camEx.CommitParameters   
    End Sub
     
    Last edited: Jul 12, 2015
  2. MaFu

    MaFu Well-Known Member Licensed 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.
     
    DonManfred likes this.
  3. Croïd

    Croïd Active Member Licensed User

    This ?

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

    But result is :24 and not size !
     

    Attached Files:

    Last edited: Jul 13, 2015
  4. MaFu

    MaFu Well-Known Member Licensed 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:
    Code:
    Dim pictureSizes() As CameraSize
    and use this code:
    Code:
    pictureSizes = camEx.GetSupportedPicturesSizes
    For Each ps As CameraSize In pictureSizes
        spinner1.Add(ps.Width&
    " x "&ps.Height)
    Next
    and in the spinner event:
    Code:
    Sub spinner1_ItemClick(Position As Int, Value As Object)
        
    Dim ps As CameraSize = pictureSizes(Position)
        camEx.SetPictureSize(ps.Width, ps.Height)
    End Sub
     
    DonManfred and Croïd like this.
  5. Croïd

    Croïd Active Member Licensed User

    Thanks MaFu,exactly what I need :)
     
  6. DonManfred

    DonManfred Expert Licensed User

    returns the LENGTH of the list of supported screensizes...
    Then you have 24 possible screensizes... You asks for the length and you got the length!
     
    Croïd likes this.
Loading...