Android相机参数setJpegQuality德precated?自定义摄像头应用程序 [英] Android Camera Parameters setJpegQuality deprecated? Custom camera application
问题描述
我要建为Android定制的摄像头应用程序。该 Camera.Parameters API包含像设置previewSize
或 setPictureSize
,那些运作良好。
I'm building a custom camera application for Android. The Camera.Parameters API contains methods like setPreviewSize
or setPictureSize
, that are working well.
不过,我想使用<一个href=\"http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setJpegQuality(int)\"相对=nofollow> setJpegQuality(INT)参数:
Camera cam = getCameraInstance();
if(cam == null){
setResult(INSTANCE_ERROR);
finish();
}
params = cam.getParameters();
params.setJpegQuality(jpegQuality);
cam.setParameters(params);
我在3个不同的设备上测试应用程序:一个的HTC Desire Z,银河S2和银河S4
I am testing my application on 3 different devices : an HTC Desire Z, a Galaxy S2 and a Galaxy S4.
setJpegQuality
正在HTC(Android版 2.2.1
)和银河S2( 4.1.2
),但未能银河S4设备( 4.2.2
)。
setJpegQuality
is working on HTC (Android 2.2.1
) and on Galaxy S2 (4.1.2
), but fails on Galaxy S4 device (4.2.2
).
所以我的问题:是这个函数去precated?是否有另一种方式来设置的画质?在开发文档,它不似乎是一个去precated功能,所以我有点迷茫......
So my question : Is this function deprecated ? Is there another way to set picture quality ? On the Developer documentation it doesnt seems to be a deprecated function so i am a little confused...
我也试过
params.set("jpeg-quality", jpegQuality);
但其相同的:(
感谢您的答案。
推荐答案
有关S3和S4,你可以写设备特定code,以减少文件的大小。
For S3 and S4, you can write device specific code to reduce the size of file.
如果你在谷歌搜索,Android的开发团队还提到,所有制造商(的 HTTPS://$c$c.google.com/p/android/issues/detail ID = 8091 ?)。相机参数和函数的实现完全取决于所使用,我认为硬件。
If you search on google, Android dev team also mentioned that it all depends on the implementation by the manufacturer(https://code.google.com/p/android/issues/detail?id=8091). The implementation of the camera parameters and function totally depends on the hardware used I think.
我已经使用运动传感器我的应用程序之一。此外,还有,我不得不写设备特定code,以获得应用所需的行为。
I had used motion sensors for one of my apps. There also, I had to write device specific code, to get the required behaviour in the app.
我知道它不是我们所期望作为一个开发者,但我相信我们,开发者,可以解决任何事情。 :)
I know its not what we expect as a developer, but i believe we, developers, can fix anything. :)
这篇关于Android相机参数setJpegQuality德precated?自定义摄像头应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!