public void CaptureImage() { var cameraCaptureTask = new Microsoft.Phone.Tasks.CameraCaptureTask(); cameraCaptureTask.Completed += (s, e) => { if (e.Error == null) { Customer.ImageStream = e.ChosenPhoto; } }; cameraCaptureTask.Show(); }
private void TakePicture_Click(object sender, EventArgs e) { Microsoft.Phone.Tasks.CameraCaptureTask cameraCapture = new Microsoft.Phone.Tasks.CameraCaptureTask(); cameraCapture.Completed += new EventHandler<Microsoft.Phone.Tasks.PhotoResult>(cameraCapture_Completed); cameraCapture.Show(); }
/// <summary> /// Starts the phone camera so that the user can capture a photo. /// WP7Manager.LastCaptureResults will be set to the captured image and text results. /// Sets PhoneApplicationService.Current.State["ReturnFromCameraCapture"] flag when application is navigated to after loading photo from camera. /// Flag should be removed once data has been processed by main thread callback (Ex: PhoneApplicationService.Current.State.Remove("ReturnFromCameraCapture");) /// </summary> /// <param name="Finished_Processing">Action method to call when processing is finished</param> public static void ScanBarcode(Action<BarcodeCaptureResult> Finished_Processing) { StartProgress(); aFinished = Finished_Processing; //Store return callback LastCaptureResults = new BarcodeCaptureResult(); //Create new result object Microsoft.Phone.Tasks.CameraCaptureTask aTask = new Microsoft.Phone.Tasks.CameraCaptureTask(); aTask.Completed += new EventHandler<Microsoft.Phone.Tasks.PhotoResult>(PhotoTask_Completed); aTask.Show(); //Load camera task }