当前位置: 首页>>代码示例>>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;未经允许,请勿转载。