本文整理匯總了Java中com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration.FlashMode方法的典型用法代碼示例。如果您正苦於以下問題:Java CameraConfiguration.FlashMode方法的具體用法?Java CameraConfiguration.FlashMode怎麽用?Java CameraConfiguration.FlashMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration
的用法示例。
在下文中一共展示了CameraConfiguration.FlashMode方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setFlashMode
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
private void setFlashMode(Camera camera, Camera.Parameters parameters, @CameraConfiguration.FlashMode int flashMode) {
try {
switch (flashMode) {
case CameraConfiguration.FLASH_MODE_AUTO:
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);
break;
case CameraConfiguration.FLASH_MODE_ON:
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON);
break;
case CameraConfiguration.FLASH_MODE_OFF:
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
break;
default:
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);
break;
}
camera.setParameters(parameters);
} catch (Exception ignore) {
}
}
示例2: setFlashModeAndBuildPreviewRequest
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
private void setFlashModeAndBuildPreviewRequest(@CameraConfiguration.FlashMode int flashMode) {
try {
switch (flashMode) {
case CameraConfiguration.FLASH_MODE_AUTO:
previewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
previewRequestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_SINGLE);
break;
case CameraConfiguration.FLASH_MODE_ON:
previewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON);
previewRequestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_SINGLE);
break;
case CameraConfiguration.FLASH_MODE_OFF:
previewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON);
previewRequestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_OFF);
break;
default:
previewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
previewRequestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_SINGLE);
break;
}
previewRequest = previewRequestBuilder.build();
try {
captureSession.setRepeatingRequest(previewRequest, captureCallback, backgroundHandler);
} catch (Exception e) {
Log.e(TAG, "Error updating preview: ", e);
}
} catch (Exception ignore) {
Log.e(TAG, "Error setting flash: ", ignore);
}
}
示例3: setFlashMode
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
public void setFlashMode(@CameraConfiguration.FlashMode int flashMode) {
cameraManager.setFlashMode(flashMode);
}
示例4: setFlashMode
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
public void setFlashMode(@CameraConfiguration.FlashMode int flashMode) {
setFlashModeAndBuildPreviewRequest(flashMode);
}
示例5: setFlashMode
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
public void setFlashMode(@CameraConfiguration.FlashMode int flashMode) {
camera2Manager.setFlashMode(flashMode);
}
示例6: setFlashMode
import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
void setFlashMode(@CameraConfiguration.FlashMode int flashMode);