• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CameraOperationCompletedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CameraOperationCompletedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# CameraOperationCompletedEventArgs类的具体用法?C# CameraOperationCompletedEventArgs怎么用?C# CameraOperationCompletedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CameraOperationCompletedEventArgs类属于命名空间,在下文中一共展示了CameraOperationCompletedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: camera_Initialized

      void camera_Initialized(object sender, CameraOperationCompletedEventArgs e)
      {
         Dispatcher.BeginInvoke(() =>
         {
            imageDetails.Text += string.Format("{0} supported resolutions.\n", camera.AvailableResolutions.Count());
            imageDetails.Text += string.Format("Current resolution: {0}\n", camera.Resolution);
            imageDetails.Text += string.Format("Preview resolution: {0}\n", camera.PreviewResolution);
         });

         camera.Initialized -= camera_Initialized;
      }
开发者ID:AdamBenoit,项目名称:Windows-Phone-8-In-Action,代码行数:11,代码来源:MainPage.xaml.cs


示例17: OnPhotoCameraInitialized

        private void OnPhotoCameraInitialized(object sender, CameraOperationCompletedEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
               _timer = new DispatcherTimer();
               _timer.Interval = TimeSpan.FromMilliseconds(250);
               _timer.Tick += (o, arg) => ScanPreviewBuffer();

               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);
            });

             Dispatcher.BeginInvoke(() =>
            {
               _previewTransform.Rotation = _photoCamera.Orientation;
               _timer.Start();
            });
        }
开发者ID:BlaiseV,项目名称:OFF,代码行数:21,代码来源:Scanner.xaml.cs


示例18: myCam_CaptureCompleted

 private void myCam_CaptureCompleted(object sender, CameraOperationCompletedEventArgs e)
 {
     //todo stuff when photo taken
 }
开发者ID:kfwls,项目名称:LocalD,代码行数:4,代码来源:CameraPage.xaml.cs


示例19: OnPhotoCameraInitialized

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

         Dispatcher.BeginInvoke(() =>
         {
            previewTransform.Rotation = photoCamera.Orientation;
            // create a luminance source which gets its values directly from the camera
            // the instance is returned directly to the reader
            luminance = new PhotoCameraLuminanceSource(width, height);
            reader = new BarcodeReader(null, bmp => luminance, null);
         });
      }
开发者ID:Bogdan-p,项目名称:ZXing.Net,代码行数:14,代码来源:MainPage.xaml.cs


示例20: _phoneCamera_AutoFocusCompleted

 void _phoneCamera_AutoFocusCompleted(object sender, CameraOperationCompletedEventArgs e)
 {
     if (e.Exception != null)
     {
         Debug.WriteLine("{0}", e.Exception.Message);
     }
 }
开发者ID:vvk-ehk,项目名称:wp-ivotingverification,代码行数:7,代码来源:MainPage.xaml.cs



注:本文中的CameraOperationCompletedEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CameraSpacePoint类代码示例发布时间:2022-05-24
下一篇:
C# CameraMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap