문제

I do not know why logact generates error when i set the camera parameters regarding setSceneMode and setColorEffect as show below, and says set parameters failed but when I set the aforementioned methods to SCENE_MODE_CANDLELIGHTand EFFECT_SOLARIZE respectively it works

JavaCode:

@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,int height) {
    // TODO Auto-generated method stub
    android.hardware.Camera.Parameters camParameter = this.myCamera.getParameters();
    camParameter.setSceneMode(Parameters.SCENE_MODE_BEACH);
    camParameter.setColorEffect(Parameters.EFFECT_WHITEBOARD);
    camParameter.setFlashMode(Parameters.FLASH_MODE_AUTO);
    camParameter.setPreviewSize(width/2, height/2);
    camParameter.setPictureSize(width/2, height/2);
    myCamera.setParameters(camParameter);
    myCamera.startPreview();
}
도움이 되었습니까?

해결책 2

In general, the Camera.Parameters class can be queried for this information at runtime for any given camera device. Note that the front and back cameras don't necessarily have the same supported modes, so you always have to get the parameters from the camera after you open it to inspect what's supported.

Specifically, you can use Camera.Parameters.getSupportedColorEffects() and Camera.Parameters.getSupportedSceneModes() to find out which of the effects and scene modes your current device supports.

다른 팁

Your device does not support CANDLELIGHT or SOLARIZE, but it does support BEACH and WHITEBOARD. Why is this strange?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top