本文介绍了打开/关闭摄像头LED /闪光灯的三星Galaxy王牌2.2.1和放大器; Galaxy Tab的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我接通摄像机LED灯使用 FLASH_MODE_ON

I am turning ON Camera LED light using FLASH_MODE_ON.

三星Galaxy王牌只有三种闪光模式:开,关和自动

Samsung Galaxy Ace have only three flash modes : on, off and auto.

FLASH_MODE_TORCH 不工作的三星Galaxy Tab和放大器;三星Galaxy王牌2.2.1

FLASH_MODE_TORCH not working in Samsung Galaxy Tab & Samsung Galaxy Ace 2.2.1

下面是我的code我如何接通我的相机LED

Here is my code how i am turning ON my Camera LED

    Camera cam;
    cam = Camera.open();
    Parameters params = cam.getParameters();
    params.setFlashMode(Parameters.FLASH_MODE_ON);
    cam.setParameters(params);
    cam.startPreview();
    cam.autoFocus(new AutoFocusCallback() {
                public void onAutoFocus(boolean success, Camera camera) {
                }
     });

和使用将其关闭:

cam.stopPreview();
cam.release();

code参考:使用相机闪光灯在Android的

但问题是LED指示灯一直亮着只为5秒。它只是然后自动关闭。

But the problem is LED Light remains on just for 5sec. It just then turns OFF automatically.

谁能告诉在哪里可以是问题。或者有什么办法打开LED灯持续,直至其请求停止。

Can anyone please tell where can be the problem. OR any way to turn ON the LED light continuously till its requested to Stop.

推荐答案

我会尽快公布我的应用程序的新版本,支持银河王牌。

I will soon released a new version of my app to support to galaxy ace.

您可以在这里下载:<一href="https://play.google.com/store/apps/details?id=droid.pr.coolflashlightfree">https://play.google.com/store/apps/details?id=droid.pr.coolflashlightfree

为了解决你的问题,你应该这样做:

In order to solve your problem you should do this:

this._camera = Camera.open();
this._camera.startPreview();
this._camera.autoFocus(new AutoFocusCallback() {
public void onAutoFocus(boolean success, Camera camera) {
}
});

Parameters params = this._camera.getParameters();
params.setFlashMode(Parameters.FLASH_MODE_ON);
this._camera.setParameters(params);

params = this._camera.getParameters();
params.setFlashMode(Parameters.FLASH_MODE_OFF);
this._camera.setParameters(params);

不用担心FLASH_MODE_OFF,因为这将保持亮,奇怪,但它是真实的

don't worry about FLASH_MODE_OFF because this will keep the light on, strange but it's true

要关闭LED只要松开相机

to turn off the led just release the camera

这篇关于打开/关闭摄像头LED /闪光灯的三星Galaxy王牌2.2.1和放大器; Galaxy Tab的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-11 22:01