当前位置: 首页>>代码示例>>C#>>正文


C# PhotoCamera.Focus方法代码示例

本文整理汇总了C#中PhotoCamera.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# PhotoCamera.Focus方法的具体用法?C# PhotoCamera.Focus怎么用?C# PhotoCamera.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhotoCamera的用法示例。


在下文中一共展示了PhotoCamera.Focus方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            photoCamera = new PhotoCamera();
            previewVideo.SetSource(photoCamera);
            photoCamera.Initialized += OnPhotoCameraInitialized;

            CameraButtons.ShutterKeyHalfPressed += (o, arg) => photoCamera.Focus();

            base.OnNavigatedTo(e);
        }
开发者ID:rmusina,项目名称:rebus,代码行数:10,代码来源:ReBusPivotMenu.xaml.cs

示例2: OnNavigatedTo

        // opening
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

             _photoCamera = new PhotoCamera();
             _photoCamera.Initialized += OnPhotoCameraInitialized;
             _previewVideo.SetSource(_photoCamera);

             CameraButtons.ShutterKeyHalfPressed += (o, arg) => _photoCamera.Focus();
        }
开发者ID:BlaiseV,项目名称:OFF,代码行数:11,代码来源:Scanner.xaml.cs

示例3: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _photoCamera = new PhotoCamera();
            _photoCamera.Initialized += OnPhotoCameraInitialized;
            _previewVideo.SetSource(_photoCamera); // _previewVideo is a VideoBrush-object

            CameraButtons.ShutterKeyHalfPressed += (o, arg) => _photoCamera.Focus();

            base.OnNavigatedTo(e);
        }
开发者ID:TWEagle,项目名称:WINDOWSPHONE8,代码行数:10,代码来源:ScannerPage.xaml.cs

示例4: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _photoCamera = new PhotoCamera();
            _photoCamera.Initialized += OnPhotoCameraInitialized;
            qrPreviewVideo.SetSource(_photoCamera);

            CameraButtons.ShutterKeyHalfPressed += (o, arg) => _photoCamera.Focus();
            if (server.name != null)
                joinMeeting();
            base.OnNavigatedTo(e);
        }
开发者ID:HKMOpen,项目名称:innovativeproject-meetingdataexchange,代码行数:11,代码来源:JoinMeetingPage.xaml.cs

示例5: OnNavigatedTo

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            _cam = new PhotoCamera();
              previewCanvas.SetSource(_cam);
              previewCanvas.RelativeTransform = new CompositeTransform() {CenterX = 0.5, CenterY = 0.5, Rotation = 90};

              _cam.CaptureImageAvailable += (sender, args) => {
              //var library = new MediaLibrary();
              string fileName = "wp8_kochbuch_" + _imgCounter + ".jpg";
              _library.SavePictureToCameraRoll(fileName, args.ImageStream);
            };

              _cam.CaptureCompleted += (sender, args) => { _imgCounter++; };

              CameraButtons.ShutterKeyPressed += (sender, args) => _cam.CaptureImage();
              CameraButtons.ShutterKeyHalfPressed += (sender, args) => _cam.Focus();
              //CameraButtons.ShutterKeyReleased += (sender, args) => { };

              base.OnNavigatedTo(e);
        }
开发者ID:rolkun,项目名称:WP8Kochbuch,代码行数:20,代码来源:MainPage.xaml.cs

示例6: MainPage

        // Constructor
        public MainPage()
        {
            InitializeComponent();

            _photoCamera = new PhotoCamera();
            _photoCamera.Initialized += OnPhotoCameraInitialized;
            _previewVideo.SetSource(_photoCamera);
            CameraButtons.ShutterKeyHalfPressed += (sender, args) => _photoCamera.Focus();

            _photoChooserTask = new PhotoChooserTask();
            _photoChooserTask.Completed += photoChooserTask_Completed;
            _photoChooserTask.Show();

            _timer = new DispatcherTimer
                         {
                             Interval = TimeSpan.FromMilliseconds(250)
                         };

            _timer.Tick += (o, arg) => ScanPreviewBuffer();
        }
开发者ID:NicoVermeir,项目名称:photobeamerclone,代码行数:21,代码来源:MainPage.xaml.cs

示例7: CameraButton_Click

      private void CameraButton_Click(object sender, RoutedEventArgs e)
      {
         if (photoCamera == null)
         {
            photoCamera = new PhotoCamera();
            photoCamera.Initialized += OnPhotoCameraInitialized;
            previewVideo.SetSource(photoCamera);

            CameraButtons.ShutterKeyHalfPressed += (o, arg) => photoCamera.Focus();
         }

         if (timer == null)
         {
            timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) };
            timer.Tick += (o, arg) => ScanPreviewBuffer();
         }

         BarcodeImage.Visibility = System.Windows.Visibility.Collapsed;
         previewRect.Visibility = System.Windows.Visibility.Visible;
         timer.Start();
      }
开发者ID:Bogdan-p,项目名称:ZXing.Net,代码行数:21,代码来源:MainPage.xaml.cs

示例8: InitializePhoneCamera

        private void InitializePhoneCamera()
        {
            _phoneCamera = new PhotoCamera(CameraType.Primary);
            _phoneCamera.Initialized += CameraInitialized;

            viewfinderBrush.SetSource(_phoneCamera);

            double cameraAspectRatioRotated = _phoneCamera.Resolution.Height / _phoneCamera.Resolution.Width;
            double deviceAspectRatio = Application.Current.Host.Content.ActualHeight / Application.Current.Host.Content.ActualWidth;
            double scaleY = cameraAspectRatioRotated * deviceAspectRatio;

            viewfinderTransform.ScaleY = scaleY;

            CameraButtons.ShutterKeyHalfPressed += CameraButtons_ShutterKeyHalfPressed;

            _phoneCamera.AutoFocusCompleted += _phoneCamera_AutoFocusCompleted;

            //Display the camera feed in the UI

            _autofocusTimer = new DispatcherTimer();
            _autofocusTimer.Interval = TimeSpan.FromMilliseconds(2000);
            _autofocusTimer.Tick += (o, arg) =>
            {
                if (_phoneCamera == null)
                {
                    return;
                }
                _phoneCamera.Focus();
            };

            // This timer will be used to scan the camera buffer every 250ms and scan for any barcodes
            _scanTimer = new DispatcherTimer();
            _scanTimer.Interval = TimeSpan.FromMilliseconds(250);
            _scanTimer.Tick += (o, arg) => ScanForBarcode();
        }
开发者ID:vvk-ehk,项目名称:wp-ivotingverification,代码行数:35,代码来源:MainPage.xaml.cs

示例9: Scan_Loaded

        void Scan_Loaded(object sender, RoutedEventArgs e)
        {
            if (photoCamera == null)
            {
                photoCamera = new PhotoCamera();
                photoCamera.Initialized += OnPhotoCameraInitialized;
                previewVideo.SetSource(photoCamera);

                CameraButtons.ShutterKeyHalfPressed += (o, arg) => photoCamera.Focus();
            }

            if (timer == null)
            {
                timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) };
                if (photoCamera.IsFocusSupported)
                {
                    photoCamera.AutoFocusCompleted += (o, arg) => { if (arg.Succeeded) ScanPreviewBuffer(); };
                    timer.Tick += (o, arg) => { try { photoCamera.Focus(); } catch (Exception) { } };
                }
                else
                {
                    timer.Tick += (o, arg) => ScanPreviewBuffer();
                }
            }

            previewRect.Visibility = System.Windows.Visibility.Visible;
            timer.Start();
        }
开发者ID:BB-streetPay,项目名称:wpapp,代码行数:28,代码来源:Scan.xaml.cs


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