camera-flash

How do I use AVCaptureFlashMode

血红的双手。 提交于 2019-12-03 14:53:25
问题 I'm making an app to allow me to stitch images together into a panoramic scene. I want to be able to turn the Flash LED on the iPhone 4 programatically. How can I do this? I read the documentation and discovered that I need to use AVCaptureFlashMode but I can't figure out how 2 use it? any help would be appreciated. Updated Code below. Thanks SIF! NSError* error = nil; NSLog(@"Setting up LED"); if([captDevice hasTorch] == NO) { NSLog(@"Error: This device doesnt have a torch"); } if(

How do I use AVCaptureFlashMode

隐身守侯 提交于 2019-12-03 03:52:47
I'm making an app to allow me to stitch images together into a panoramic scene. I want to be able to turn the Flash LED on the iPhone 4 programatically. How can I do this? I read the documentation and discovered that I need to use AVCaptureFlashMode but I can't figure out how 2 use it? any help would be appreciated. Updated Code below. Thanks SIF! NSError* error = nil; NSLog(@"Setting up LED"); if([captDevice hasTorch] == NO) { NSLog(@"Error: This device doesnt have a torch"); } if([captDevice isTorchModeSupported:AVCaptureTorchModeOn] == NO) { NSLog(@"Error: This device doesnt support

Switch flash in Camera2 API

烈酒焚心 提交于 2019-12-01 19:08:16
My problem is when I switch between different flashmodes and then want to capture an image, my captureBuilder won't set the chosen flashmode. It only works when i close and reopen the camera. I took the https://github.com/googlesamples/android-Camera2Basic as a starting point. my method: private void captureStillPicture() { try { final Activity activity = (Activity) context; if (null == activity || null == mCameraDevice) { return; } // This is the CaptureRequest.Builder that we use to take a picture. CaptureRequest.Builder captureBuilder = mCameraDevice.createCaptureRequest(CameraDevice

android : camera.getParameters() crashes app

僤鯓⒐⒋嵵緔 提交于 2019-12-01 12:21:53
i'm using this code to use the camera LED as flashlight but it crashes when the service starts. Using Log.w() statements i found it stops at param = camera.getParameters();. i have included the android.permission.CAMERA in my manifest. i don't understand what causes the crash. how can i fix this? public class Flashlight extends Service { private Camera camera; private Parameters param; private final IBinder mBinder = new LocalBinder(); public class LocalBinder extends Binder { Flashlight getService() { return Flashlight.this; } } public int onStartCommand(Intent intent, int flags, int startId)

Accessing AutoFocus/Flash with Google Vision BarCode Reader

时光总嘲笑我的痴心妄想 提交于 2019-12-01 03:53:32
I am playing with the original example of BarCode scanner here: https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/BarcodeCaptureActivity.java They are able to start the AutoFocus/Flash within the camera factory like this: // Creates and starts the camera. Note that this uses a higher resolution in comparison // to other detection examples to enable the barcode detector to detect small barcodes // at long distances. CameraSource.Builder builder = new CameraSource.Builder

Accessing AutoFocus/Flash with Google Vision BarCode Reader

こ雲淡風輕ζ 提交于 2019-11-28 03:33:47
问题 I am playing with the original example of BarCode scanner here: https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/BarcodeCaptureActivity.java They are able to start the AutoFocus/Flash within the camera factory like this: // Creates and starts the camera. Note that this uses a higher resolution in comparison // to other detection examples to enable the barcode detector to detect small

Can I change the LED intensity of an Android device?

丶灬走出姿态 提交于 2019-11-26 22:08:14
Is there a way to set the LED intensity that I desire? I know that to turn on the LED I use: p.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); mycam.setParameters(p); But this code just turns on the LED. But is there a way to set different intensities to the LED for a stronger light or to reduce the light intensity? HTC has an alternative API that supports this, however it's only on HTC Sense devices, and as of Gingerbread they've changed the permissions so it's only for their Flashlight app, not third party ones (unless you use root). But on 2.2 HTC devices you can use it by writing a