void cam_Initialized(object sender, CameraOperationCompletedEventArgs e) { int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width); int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height); _luminance = new PhotoCameraLuminanceSource(width, height); Dispatcher.BeginInvoke(() => { _previewTransform.Rotation = _photoCamera.Orientation; _timer.Start(); }); _photoCamera.FlashMode = FlashMode.Auto; _photoCamera.Focus(); }