Domanda

Im trying to capture image with Macro focus on, it worked with Samsung Note II(4.3) and with Samsung galaxy S III(4.3), but when i try it on Note III(4.4) it did not work (close up objects is not clear where far objects is).

Here is my code:

@Override
public void surfaceCreated(SurfaceHolder holder) {
    // TODO Auto-generated method stub
    try {
        Camera.Parameters params = mCamera.getParameters();

        List<String> focusModes = params.getSupportedFocusModes();
        if (focusModes.contains(Parameters.FOCUS_MODE_MACRO))
            params.setFocusMode(Parameters.FOCUS_MODE_MACRO);
        mCamera.setParameters(params);
        mCamera.setPreviewDisplay(holder);
        mCamera.startPreview();
    } catch (IOException e) {
        Log.d(TAG, "Error setting camera preview: " + e.getMessage());
    }
}
È stato utile?

Soluzione

FOCUS_MODE_MACRO did not work, However replacing MACRO mode with FOCUS_MODE_CONTINUOUS_PICTURE did the job; with Note 3 and for other devices as well.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top