void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { this.Dispatcher.BeginInvoke(delegate() { _phoneCamera.FlashMode = FlashMode.Off; _previewBuffer = new WriteableBitmap((int)_phoneCamera.PreviewResolution.Width, (int)_phoneCamera.PreviewResolution.Height); _barcodeReader = new BarcodeReader(); _barcodeReader.Options.TryHarder = true; _barcodeReader.ResultFound += _bcReader_ResultFound; _barcodeReader.Options.PossibleFormats = new List <BarcodeFormat>() { BarcodeFormat.EAN_13 }; _scanTimer.Start(); }); } else { Dispatcher.BeginInvoke(() => { MessageBox.Show("Unable to initialize the camera"); }); } }
void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { this.Dispatcher.BeginInvoke(delegate() { _phoneCamera.FlashMode = FlashMode.Off; _previewBuffer = new WriteableBitmap((int)_phoneCamera.PreviewResolution.Width, (int)_phoneCamera.PreviewResolution.Height); _barcodeReader = new BarcodeReader(); // By default, BarcodeReader will scan every supported barcode type // If we want to limit the type of barcodes our app can read, // we can do it by adding each format to this list object //var supportedBarcodeFormats = new List<BarcodeFormat>(); //supportedBarcodeFormats.Add(BarcodeFormat.QR_CODE); //supportedBarcodeFormats.Add(BarcodeFormat.DATA_MATRIX); //_barcodeReader.PossibleFormats = supportedBarcodeFormats; _barcodeReader.TryHarder = true; _barcodeReader.ResultFound += _bcReader_ResultFound; _scanTimer.Start(); }); } else { Dispatcher.BeginInvoke(() => { MessageBox.Show("Unable to initialize the camera"); }); } }
void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { this.Dispatcher.BeginInvoke(delegate() { txtDebug.Text = "Camera initialized"; }); } }
// Update the UI if initialization succeeds. void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { this.Dispatcher.BeginInvoke(delegate() { ShutterButton.Visibility = System.Windows.Visibility.Visible; }); } }
// Update the UI if initialization succeeds. void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { try { if (e.Succeeded) { cam.FlashMode = FlashMode.Off; cam.Resolution = cam.AvailableResolutions.First(); } } catch (Exception ex) { LittleWatson.ReportException(ex); } }
// Update the UI if initialization succeeds. private void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { this.Dispatcher.BeginInvoke(delegate() { // Write message. //txtDebug.Text = "Camera initialized."; //isCameraInitialized = true; }); } }
// Update the UI if initialization succeeds. void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { this.Dispatcher.BeginInvoke(delegate() { // Write message. txtDebug.Text = "Camera initialized."; // Set flash button text. FlashButton.Content = "Fl:" + cam.FlashMode.ToString(); }); } }
void CameraInitialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { this.Dispatcher.BeginInvoke(delegate() { DisplayWelcomeMessage(); }); } else { Dispatcher.BeginInvoke(() => { MessageBox.Show("Unable to initialize the camera"); }); } }
// Update the UI if initialization succeeds. void PhotoCameraOnInitialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { if (e.Succeeded) { // Disable the flash to avoid reflections _photoCamera.FlashMode = FlashMode.Off; int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); _reader = new BarcodeReader(null, bmp => _luminance, null); _reader.ResultFound += ReaderOnResultFound; Dispatcher.BeginInvoke(() => _photoCamera.Focus()); } }
private void CameraInitialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { cameraReady = e.Succeeded; if (cameraReady) { if (camera.PreviewResolution.Width != cameraWidth || camera.PreviewResolution.Height != cameraHeight) { throw new GoblinException(cameraWidth + "x" + cameraHeight + " is not supported. The supported resolutions is: " + camera.PreviewResolution.Width + "x" + camera.PreviewResolution.Height); } luminance = new byte[cameraWidth * cameraHeight]; } else { Notifier.AddMessage(e.Exception.Message); } }
void cam_Initialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { Deployment.Current.Dispatcher.BeginInvoke(() => { timer.Interval = TimeSpan.FromMilliseconds(5.0); timer.Tick += new EventHandler(callback); timer.Start(); }); if (!cam.IsFlashModeSupported(FlashMode.On)) { System.Diagnostics.Debug.WriteLine("No flash support!"); } else { cam.FlashMode = FlashMode.On; } }
private void cam_CaptureCompleted(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { }
private void cam_AutoFocusCompleted(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { cam.CaptureImage(); }
/// <summary> /// Called when the <see cref="PhotoCamera.CaptureCompleted"/> event occurs. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="Microsoft.Devices.CameraOperationCompletedEventArgs"/> instance containing the event data.</param> private void OnPhotoCameraCaptureCompleted(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { RaiseCaptureCompleted(new CameraOperationCompletedEventArgs(e.Exception)); }
void camInitialized(object sender, Microsoft.Devices.CameraOperationCompletedEventArgs e) { System.Diagnostics.Debug.WriteLine("Initialized"); cam.FlashMode = FlashMode.Off; setToLargestRes(); }