Android Question CameraEx - Camera Panel Display Not Clear

Richard Goh

Active Member
Licensed User
Longtime User
I am testing on the camera on CameraEx Library and sample program on my samsung galaxy. The photos taken is clear but the camera panel display on the screen is blur. How can I make the camera panel display to be clear (like using samsung camera option)? Thank you.
 

Richard Goh

Active Member
Licensed User
Longtime User
Height=144
Width=176

Attached is a screenshot and photos taken by the camera.
 

Attachments

  • Screenshot_2016-06-16-13-28-00.png
    Screenshot_2016-06-16-13-28-00.png
    363.3 KB · Views: 158
Last edited:
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
I set the preview size in the camera_ready and panel_touch method but still make no different.

B4X:
Sub Camera1_Ready (Success As Boolean)
    If Success Then
        camEx.JpegQuality=90
        Dim size As CameraSize = camEx.GetPreviewSize
        camEx.SetPreviewSize(1080,1920)
        camEx.SetContinuousAutoFocus
        camEx.CommitParameters
        camEx.StartPreview
        Camera_LogFeatures
     
    Else
        ToastMessageShow("Cannot open camera.", True)
    End If
End Sub

Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean
    camEx.SetPreviewSize(600,800)
    Return True
End Sub
 
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
here the output.

Log(CamEx.GetSupportedPreviewSizes)
(ArrayList) [android.hardware.Camera$Size@57dac0, android.hardware.Camera$Size@9fbc30, android.hardware.Camera$Size@13f7860, android.hardware.Camera$Size@1676730, android.hardware.Camera$Size@18f5678, android.hardware.Camera$Size@1ff2700, android.hardware.Camera$Size@27eefd0, android.hardware.Camera$Size@3be67b8]

Log(CamEx.GetPreviewSize)
[Height=1920, IsInitialized=false, Width=1080]
 
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
Hi Erel, I did tried that earlier. It's just reset the preview panel size but the display remain same and doesn't changed at all.
 
Upvote 0

Richard Goh

Active Member
Licensed User
Longtime User
Here the screen. Before is before running Panel1_Touch. After is after Panel1_Touch method is executed.

B4X:
Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean

    Dim size As CameraSize = camEx.GetPreviewSize
    Dim ratio As Double = size.Width / size.Height
    Dim pw, ph As Int
    If 100%y * ratio > 100%x Then
       pw = 100%x
       ph = pw / ratio
    Else
       ph = 100%y
       pw = ph * ratio
    End If
    Panel1.SetLayout(50%x - pw / 2, 50%y - ph / 2, pw, ph)
    Return True

End Sub
 

Attachments

  • Screenshot_2016-06-17-13-53-46.png
    Screenshot_2016-06-17-13-53-46.png
    455.9 KB · Views: 175
Upvote 0
Top