Reputation: 418
Below is my code:
private void takeMultiPictures(final int n) {
if (n <= 0) {
ToastUtils.show("Capture Successfully!");
saveMultiPictures();
return;
}
Parameters params = mCamera.getParameters();
int mic = params.getMinExposureCompensation();
int mac = params.getMaxExposureCompensation();
switch (n) {
case 3:
params.setExposureCompensation(mac);
break;
case 2:
params.setExposureCompensation(mic);
break;
case 1:
params.setExposureCompensation(0);
break;
}
mCamera.setParameters(params);
mCamera.takePicture(null, null, null, new PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
mMultiPictures.add(data);
mCamera.startPreview();
takeMultiPictures(n - 1);
}
});
}
By this code, the camera will take 3 pictures, but the results are not stable.
The First Photo
The Second Photo
The Thrid Photo
My device is Galaxy Nexus, the exposure compensation values supported are from -2 to 2.
Upvotes: 0
Views: 871
Reputation: 51
Did you look at the return values of
int mic = params.getMinExposureCompensation();
int mac = params.getMaxExposureCompensation();
Are they actually -2 and 2?
you could call
mCamera.getParameters(params);
after setting the parameters to check if your setting holds.
Upvotes: 1