问题
When I load the camera in my app with a Samsung Galaxy S3 on Android 4.0.4, the preview image is just green and fuzzy with horizontal noise. The camera button looks fine. When I take the picture, the saved file looks good. I tested the build in camera app and it works just fine.
This issue does not happen on a Samsung Galaxy S and Motorola Electrify running Android 2.3.
I use Rhomobile for development. Here is a link to the Android camera source code: https://github.com/rhomobile/rhodes/tree/master/platform/android/Rhodes/src/com/rhomobile/rhodes/camera
This is what I get when I bring up the camera:
My setup: - Samsung Galaxy S3 on Android 4.0.4 - Rhodes 3.4.2 - minSDK: 8 - Android SDK: 4.1
回答1:
I fixed this problem by changing my camera setting from:
settings = {:desired_width => 800, :desired_height => 800, :flash_mode => 'auto'} Camera::take_picture(url_for(:action => :camera_callback_new), settings)
to
settings = {:desired_width => 1024, :desired_height => 1024, :flash_mode => 'auto'} Camera::take_picture(url_for(:action => :camera_callback_new), settings)
来源:https://stackoverflow.com/questions/13350490/android-camera-preview-is-incorrect-on-samsung-galaxy-s3