Android相机预览在Samsung Galaxy S3上不正确 [英] Android Camera Preview is incorrect on Samsung Galaxy S3
问题描述
当我在Android 4.0.4上使用Samsung Galaxy S3在我的应用程序中加载相机时,预览图像只是绿色且模糊,并带有水平噪点.相机按钮看起来不错.当我拍照时,保存的文件看起来不错.我测试了相机中的内置应用,效果很好.
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.
运行Android 2.3的Samsung Galaxy S和Motorola Electrify不会发生此问题.
This issue does not happen on a Samsung Galaxy S and Motorola Electrify running Android 2.3.
我使用Rhomobile进行开发.这是指向Android相机源代码的链接: https://github.com/rhomobile/rhodes/tree/master/platform/android/Rhodes/src/com/rhomobile/rhodes/camera
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:
我的设置: -Android 4.0.4上的Samsung Galaxy S3 -罗德3.4.2 -minSDK:8 -Android SDK:4.1
My setup: - Samsung Galaxy S3 on Android 4.0.4 - Rhodes 3.4.2 - minSDK: 8 - Android SDK: 4.1
推荐答案
我通过更改以下摄像机的设置来解决此问题:
I fixed this problem by changing my camera setting from:
settings = {:: desired_width => 800,:desired_height => 800,:flash_mode =>'auto'} 摄影机::拍照(url_for(:action =>:camera_callback_new),设置)
settings = {:desired_width => 800, :desired_height => 800, :flash_mode => 'auto'} Camera::take_picture(url_for(:action => :camera_callback_new), settings)
到
settings = {:: desired_width => 1024,:desired_height => 1024,:flash_mode =>'auto'} 摄影机::拍照(url_for(:action =>:camera_callback_new),设置)
settings = {:desired_width => 1024, :desired_height => 1024, :flash_mode => 'auto'} Camera::take_picture(url_for(:action => :camera_callback_new), settings)
这篇关于Android相机预览在Samsung Galaxy S3上不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!