private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e) { MobileBarcodeScanner.Log("Initialized Camera"); if (_photoCamera == null) { return; } MobileBarcodeScanner.Log("Creating Luminance Source"); var width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); var height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); var supportedCameraModes = AudioVideoCaptureDevice.GetSupportedPropertyValues(_photoCamera.SensorLocation, KnownCameraAudioVideoProperties.VideoTorchMode); if (supportedCameraModes.ToList().Contains((UInt32)VideoTorchMode.On)) { _photoCamera.SetProperty(KnownCameraAudioVideoProperties.VideoTorchMode, VideoTorchMode.Off); } _initialized = true; MobileBarcodeScanner.Log("Luminance Source Created"); OnCameraInitialized(_initialized); }
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e) { try { if (_photoCamera == null) { return; } var width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); var height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); _photoCamera.FlashMode = FlashMode.Off; _initialized = true; OnCameraInitialized(_initialized); } catch { InitializeCamera(); //Re-Initialize Camera } }
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e) { MobileBarcodeScanner.Log("Initialized Camera"); if (_photoCamera == null) { return; } MobileBarcodeScanner.Log("Creating Luminance Source"); var width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); var height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); if (_photoCamera.IsFlashModeSupported(FlashMode.On)) { _photoCamera.FlashMode = FlashMode.Off; } _initialized = true; MobileBarcodeScanner.Log("Luminance Source Created"); OnCameraInitialized(_initialized); }
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e) { var width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); var height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); _photoCamera.FlashMode = FlashMode.Off; _initialized = true; OnCameraInitialized(_initialized); }
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e) { MobileBarcodeScanner.Log("Initialized Camera"); if (_photoCamera == null) return; MobileBarcodeScanner.Log("Creating Luminance Source"); var width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); var height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); var supportedCameraModes = AudioVideoCaptureDevice.GetSupportedPropertyValues(_photoCamera.SensorLocation, KnownCameraAudioVideoProperties.VideoTorchMode); if (supportedCameraModes.ToList().Contains((UInt32)VideoTorchMode.On)) { _photoCamera.SetProperty(KnownCameraAudioVideoProperties.VideoTorchMode, VideoTorchMode.Off); } _initialized = true; MobileBarcodeScanner.Log("Luminance Source Created"); OnCameraInitialized(_initialized); }
private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e) { MobileBarcodeScanner.Log("Initialized Camera"); if (_photoCamera == null) return; IsAnalyzing = true; MobileBarcodeScanner.Log("Creating Luminance Source"); var width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); var height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); if (_photoCamera.IsFlashModeSupported(FlashMode.On)) _photoCamera.FlashMode = FlashMode.Off; _initialized = true; MobileBarcodeScanner.Log("Luminance Source Created"); OnCameraInitialized(_initialized); }