Question

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();
}
Was it helpful?

Solution 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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top