flashlight

How do I delay a for loop in swift without interrupting the main thread?

左心房为你撑大大i 提交于 2021-01-28 06:47:05
问题 I am trying to read through a string one character a time delaying .1 seconds before moving on to the next character. I have tried implementing the delay function inside the for loop but it has two problems. 1. The delay is inconsistent and does not take the same amount of time when moving between characters. 2. It disrupts the main thread which I think is the cause of the camera view freezing. However, I think it is also possible that activating the flashlight while the camera is on freezes

iOS: Torch level on iPhone 11 Pro

亡梦爱人 提交于 2020-06-10 09:59:19
问题 I'm using AVCaptureDevice.setTorchModeOn(level) method to turn on the flashlight at variable brightness. On my old iPhone SE it's working fine — I can clearly see 4 different brightness levels as I change level from 0 to 1 . But on the iPhone 11 Pro the flashlight turns on only when level is 1.0 ! And it's brightness if far from maximum level (compared to flashlight from Control Center). I tried using maxAvailableTorchLevel constant, but results are the same as using 1.0 . Also tried values

How can i create Flashlight app in uwp C#

两盒软妹~` 提交于 2020-04-10 06:01:15
问题 I have Lumia 830 and i've tried to create flashlight app in UWP C#. my device Flashlight works great but i don't know why i can't create my own app turn on / off Torch of my phone. I use Lamp class : var lamp = await Lamp.GetDefaultAsync(); if (lamp == null) { ShowErrorMessage("No Lamp device found"); return; } lamp.IsEnabled = true; when run this code on my phone "lamp" is null and it couldn't find my FlashLED. I've got this code from MSDN.Microsoft.com and thay said If the returned object

How to find flashlight feature is available or not in device < = sdk 4

自古美人都是妖i 提交于 2020-01-06 08:14:58
问题 I used to find the flashlight is available or not using this code context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH); but this code is support for sdk version >= 7 lower version is not supporting. so anybody help to find whether the flashlight is available in lower version Thanks in advance 回答1: Android SDK has Camera class.. you can try getFlashMode method .. If method return null then flash is not support... http://developer.android.com/reference/android

Android how to know if flashlight is on

﹥>﹥吖頭↗ 提交于 2020-01-04 03:14:29
问题 I am using CameraManager and CameraCharacteristics I would like to know how to check if the flashlight is turned on 回答1: Try this bit of code public boolean FlashStatus() { Camera.Parameters parameters = camera.getParameters(); if (parameters.getFlashMode() == "FLASH_MODE_TORCH") { return true; } if (parameters.getFlashMode() == "FLASH_MODE_OFF") { return false; } } 来源: https://stackoverflow.com/questions/38827344/android-how-to-know-if-flashlight-is-on

Iphone flashlight not working while app is in background

左心房为你撑大大i 提交于 2020-01-03 08:44:32
问题 Hi i am using a location based app and wants to use iphone camera flashlight while in background.Unfortunately flashlight is working only in foreground ,it automatically turns off the flash in background even though the code is executing . The code i used is working only in foreground #import <AVFoundation/AVFoundation.h> //flashcode Class captureDeviceClass = NSClassFromString(@"AVCaptureDevice"); if (captureDeviceClass != nil) { AVCaptureDevice *device = [AVCaptureDevice

Turn ON/OFF Camera LED/flash light in Samsung Galaxy Ace 2.2.1 & Galaxy Tab

孤者浪人 提交于 2019-12-28 02:44:14
问题 I am turning ON Camera LED light using FLASH_MODE_ON . Samsung Galaxy Ace have only three flash modes : on, off and auto. FLASH_MODE_TORCH not working in Samsung Galaxy Tab & Samsung Galaxy Ace 2.2.1 Here is my code how i am turning ON my Camera LED Camera cam; cam = Camera.open(); Parameters params = cam.getParameters(); params.setFlashMode(Parameters.FLASH_MODE_ON); cam.setParameters(params); cam.startPreview(); cam.autoFocus(new AutoFocusCallback() { public void onAutoFocus(boolean success

Android camera2 api openCamera error

会有一股神秘感。 提交于 2019-12-25 07:49:13
问题 I want to make a simple flashlite application using camera2 api. I am using the following code: public class FlashLightUtilForL { private CameraCaptureSession mSession; private CaptureRequest.Builder mBuilder; private CameraDevice mCameraDevice; private CameraManager mCameraManager; public FlashLightUtilForL(Context context) { try { mCameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE); //here to judge if flash is available CameraCharacteristics

Turn flashlight on/off In QRcodeScanner React native

你说的曾经没有我的故事 提交于 2019-12-23 17:12:59
问题 im using react-native-qrcode-scanner and what i want to do is : when user press on a flashlight icon flashLight go on i done this : <QRCodeScanner showMarker onRead={this.onSuccess.bind(this)} cameraStyle={{ height: SCREEN_HEIGHT }} cameraProps={{ flashMode: this.state.flashLight ? RNCamera.Constants.FlashMode.on : RNCamera.Constants.FlashMode.off, captureAudio: false }} camera prop works but when i change the state.flashLight (true or false) the flashLight not change any Idea how change

Flashlight (Torch) is opening but not closing

半城伤御伤魂 提交于 2019-12-23 05:27:34
问题 Following is the code which I used for opening Torch and closing it. But when I close it, it crashes. LogCat says " Runtime Exception : Fail to connect to camera service "! + hasFlash is not getting any value and is throwing Nullpointer exception. (I'm using it to check if the flash is present or not.) What am I doing Wrong? boolean hasFlash = this.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH); if(hasFlash==true) { if(s.equalsIgnoreCase("FlashLight On") || s