當前位置: 首頁>>代碼示例>>C#>>正文


C# CameraOperationCompletedEventArgs類代碼示例

本文整理匯總了C#中CameraOperationCompletedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# CameraOperationCompletedEventArgs類的具體用法?C# CameraOperationCompletedEventArgs怎麽用?C# CameraOperationCompletedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CameraOperationCompletedEventArgs類屬於命名空間,在下文中一共展示了CameraOperationCompletedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CameraInitialized

        /// <summary>
        /// Called when device camera initialized.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="CameraOperationCompletedEventArgs"/> instance containing the event data.</param>
        private void CameraInitialized(object sender, CameraOperationCompletedEventArgs e)
        {
            if (e.Succeeded)
            {
                // Start scan process in separate thread
                Deployment.Current.Dispatcher.BeginInvoke(
                    () =>
                        {
                            while (result == null)
                            {
                                var cameraBuffer = new WriteableBitmap(
                                    (int)camera.PreviewResolution.Width,
                                    (int)camera.PreviewResolution.Height);

                                camera.GetPreviewBufferArgb32(cameraBuffer.Pixels);
                                cameraBuffer.Invalidate();

                                reader.Decode(cameraBuffer);
                            }
                        });
            }
            else
            {
                this.result = new BarcodeScannerTask.ScanResult(TaskResult.None);
                NavigationService.GoBack();
            }
        }
開發者ID:CareWB,項目名稱:WeX5,代碼行數:32,代碼來源:BarcodeScannerUI.xaml.cs

示例2: cam_Initialized

        private void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
        {
            if (!e.Succeeded)
            {
                cam = null;
                return;
            }

            try
            {
                cam = (PhotoCamera)sender;
                cam.Resolution = cam.AvailableResolutions.First();
            }
            catch (Exception)
            {
                cam = null;
                return;
            }

            this.Dispatcher.BeginInvoke(delegate()
            {
                if (cam == null)
                    return;

                WriteableBitmap bitmap = new WriteableBitmap((int)cam.PreviewResolution.Width,
                                                             (int)cam.PreviewResolution.Height);
                frameStart = DateTime.Now;
                cam.GetPreviewBufferArgb32(bitmap.Pixels);
                detectFaces(bitmap);
            });
        }
開發者ID:viperium,項目名稱:WatchDogWP8,代碼行數:31,代碼來源:CalibrationScreen.xaml.cs

示例3: _phoneCamera_AutoFocusCompleted

 void _phoneCamera_AutoFocusCompleted(object sender, CameraOperationCompletedEventArgs e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(delegate()
     {
         focusBrackets.Visibility = Visibility.Collapsed;
     });
 }
開發者ID:wesee,項目名稱:RideNow,代碼行數:7,代碼來源:MainPage.xaml.cs

示例4: OnCameraInitialized

		private void OnCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
		{
			if (e.Succeeded)
			{
				this.Dispatcher.BeginInvoke(() =>
				{
					this.phoneCamera.FlashMode = FlashMode.Auto;
					this.phoneCamera.Focus();

					this.previewBuffer = new WriteableBitmap((int)this.phoneCamera.PreviewResolution.Width, (int)this.phoneCamera.PreviewResolution.Height);
					this.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);
					//_bcReader.PossibleFormats = supportedBarcodeFormats;

					this.barcodeReader.Options.TryHarder = true;

					this.barcodeReader.ResultFound += this.OnBarcodeResultFound;
					this.scanTimer.Start();
				});
			}
			else
			{
				this.Dispatcher.BeginInvoke(() =>
				{
					this.BarcodeScannerPlugin.OnScanFailed("Unable to initialize the camera");
				});
			}
		}
開發者ID:gxl-wex5,項目名稱:WeX5_V3.3_pre_test,代碼行數:35,代碼來源:Scan.xaml.cs

示例5: camera_CaptureCompleted

 void camera_CaptureCompleted(object sender, CameraOperationCompletedEventArgs e)
 {
     if (!e.Succeeded)
     {
         photoContainer.Fill = new SolidColorBrush(Colors.Gray);
         imageDetails.Text = "Camera capture failed.\n" + e.Exception.Message;
     }
     CleanUpCamera();
 }
開發者ID:amrzagloul,項目名稱:Windows-Phone-8-In-Action,代碼行數:9,代碼來源:MainPage.xaml.cs

示例6: cam_Initialized

        void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
        {
            Dictionary<object, object> zxingHints 
                = new Dictionary<object, object>() { { DecodeHintType.TRY_HARDER, true } };
            _cam.FlashMode = FlashMode.Auto;
            _reader = new MultiFormatUPCEANReader(zxingHints);

            _cam.Focus();                    
        }
開發者ID:chovik,項目名稱:SmartLib-WP7,代碼行數:9,代碼來源:ScanBarCode.xaml.cs

示例7: OnPhotoCameraInitialized

        private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
        {
            int width = Convert.ToInt32(PhotoCamera.PreviewResolution.Width);
            int height = Convert.ToInt32(PhotoCamera.PreviewResolution.Height);

            luminance = new PhotoCameraLuminanceSource(width, height);
            qrReader = new QRCodeReader();
            ean13Reader = new EAN13Reader();
            code39Reader = new Code39Reader();

            timer = new Timer((s) => ScanPreviewBuffer(), null, 0, 250);
        }
開發者ID:chovik,項目名稱:SmartLib-WP7,代碼行數:12,代碼來源:ScannerViewModel.cs

示例8: camera_Initialised

        //------------QR CODE -----------------

        private void camera_Initialised(object sender, CameraOperationCompletedEventArgs e)
        {
            // set the camera resolution
            if (e.Succeeded)
            {
                var res = from resolution in camera.AvailableResolutions
                          where resolution.Width == 640
                          select resolution;

                camera.Resolution = res.First();
            }
        }
開發者ID:CLAP-Project,項目名稱:ClapApp,代碼行數:14,代碼來源:LoginPivot.xaml.cs

示例9: CameraAutoFocusCompleted

 private void CameraAutoFocusCompleted(object sender, CameraOperationCompletedEventArgs e)
 {
     Action action = () => {
                         lock (this) {
                             try {
                                 camera.CaptureImage();
                             } catch (Exception exception) {
                                 Deployment.Current.Dispatcher.BeginInvoke(() => MessageBox.Show(exception.ToString()));
                             }
                         }
                     };
     Deployment.Current.Dispatcher.BeginInvoke(action);
 }
開發者ID:KnownSubset,項目名稱:Rephoto,代碼行數:13,代碼來源:Rephoto.xaml.cs

示例10: OnPhotoCameraInitialized

        private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
        {
            int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width);
            int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height);
            
            _luminance = new PhotoCameraLuminanceSource(width, height);
            _reader = new QRCodeReader();

            Dispatcher.BeginInvoke(() => {
                _previewTransform.Rotation = _photoCamera.Orientation;
                _timer.Start();
            });
        }
開發者ID:casablancas,項目名稱:MuseosApp,代碼行數:13,代碼來源:QR.xaml.cs

示例11: _camera_Initialized

		void _camera_Initialized(object sender, CameraOperationCompletedEventArgs e)
		{
			if (e.Succeeded == true)
			{
				Dispatcher.BeginInvoke(() =>
				{
					VisualStateManager.GoToState(this, StartCaptureState.Name, false);
				});
			}
			else
			{
				//TODO : 카메라 초기화 실패시에 재시도 처리가 필요함.
			}
		}
開發者ID:romeowa,項目名稱:pisa,代碼行數:14,代碼來源:CameraControl.xaml.cs

示例12: OnPhotoCameraInitialized

        private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
        {
            int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width);
            int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height);

            this._luminance = new PhotoCameraLuminanceSource(width, height);
            this._reader = new BarcodeReader();
            _reader.Options.TryHarder = true;

            Dispatcher.BeginInvoke(() => _previewTransform.Rotation = _photoCamera.Orientation);

            _photoCamera.Resolution = _photoCamera.AvailableResolutions.First();

            _isInitialized = true;
        }
開發者ID:n1rvana,項目名稱:ZXing.NET,代碼行數:15,代碼來源:MainPage.xaml.cs

示例13: cam_Initialized

        void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
        {
            //int width = Convert.ToInt32(_photoCamera.PreviewResolution.Width);
            //int height = Convert.ToInt32(_photoCamera.PreviewResolution.Height);
            int width = 640;
            int height = 480;
            _luminance = new PhotoCameraLuminanceSource(width, height);

            Dispatcher.BeginInvoke(() =>
            {
                _previewTransform.Rotation = _photoCamera.Orientation;
                _timer.Start();
            });
            _photoCamera.FlashMode = FlashMode.Auto;
            _photoCamera.Focus();
        }
開發者ID:jevonsflash,項目名稱:Healthcare,代碼行數:16,代碼來源:BarCode.xaml.cs

示例14: CollectCameraCaps

        void CollectCameraCaps(object sender, CameraOperationCompletedEventArgs e)
        {
            var camera = sender as PhotoCamera;
            if (camera == null)
                return;

            if (camera.CameraType == CameraType.Primary)
            {
                CurrentCameraResolution = camera.Resolution;
                HasFocusAtPoint = camera.IsFocusAtPointSupported;
                HasFocus = camera.IsFocusSupported;
                PhotoPixelLayout = camera.YCbCrPixelLayout;
                SupportedResolutions = camera.AvailableResolutions;
            }

            UninitializeCamera(camera);
        }
開發者ID:seriema,項目名稱:WP7Caps,代碼行數:17,代碼來源:CameraInfo.cs

示例15: cam_Initialized

        private void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
        {
            if (e.Succeeded)
            {
                Dispatcher.BeginInvoke(delegate
                {
                    _phoneCamera.FlashMode = FlashMode.Off;
                    _previewBuffer = new WriteableBitmap((int)_phoneCamera.PreviewResolution.Width,
                        (int)_phoneCamera.PreviewResolution.Height);

                    _barcodeReader = new BarcodeReader { Options = { TryHarder = true } };

                    _barcodeReader.ResultFound += _bcReader_ResultFound;
                    _scanTimer.Start();
                });
            }
            else
                Dispatcher.BeginInvoke(() => MessageBox.Show("No se ha podido inicializar la cámara!"));

        }
開發者ID:rwecho,項目名稱:Windows-Phone-Samples,代碼行數:20,代碼來源:MainPage.xaml.cs


注:本文中的CameraOperationCompletedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。