surendra
surendra

Reputation: 2277

Application is crashing while calling camera.setParameters(parameters);

In my android application I am using custom camera with effects. While i am calling

parameters.setColorEffect(Camera.Parameters.EFFECT_NEGATIVE);
camera.setParameters(parameters);

the application is working well but while I am calling

parameters.setColorEffect(Camera.Parameters.EFFECT_BLACKBOARD);
camera.setParameters(parameters);

the application leads to the following exception

01-21 17:32:13.656: E/AndroidRuntime(5932): java.lang.RuntimeException: setParameters failed
01-21 17:32:13.656: E/AndroidRuntime(5932):     at android.hardware.Camera.native_setParameters(Native Method)
01-21 17:32:13.656: E/AndroidRuntime(5932):     at android.hardware.Camera.setParameters(Camera.java:1494)

Can anyone help me.

Thanks.

Upvotes: 2

Views: 94

Answers (1)

Zar E Ahmer
Zar E Ahmer

Reputation: 34390

It means the EFFECT_BLACKBOARD is not supported by your device. You must check whether the ColorEffect is supported by your Device.

CameraParameters.getSupportedColorEffects();

And check if it contains your effect then apply it.

Upvotes: 1

Related Questions