Exemple #1
0
        private bool stopCamera()
        {
            if (_photoCamera == null)
            {
                return(false);
            }
            _timer.Stop();
            _timer     = null;
            _luminance = null;
            _reader    = null;
            _photoCamera.Dispose();
            _photoCamera = null;

            return(true);
        }
Exemple #2
0
        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 QRCodeReader();
            });

            Dispatcher.BeginInvoke(() =>
            {
                _previewTransform.Rotation = _photoCamera.Orientation;
                _timer.Start();
            });
        }
Exemple #3
0
        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();
            });
        }
Exemple #4
0
        private bool stopCamera()
        {
            if (_photoCamera == null)
             {
            return false;
             }
             _timer.Stop();
             _timer = null;
             _luminance = null;
             _reader = null;
             _photoCamera.Dispose();
             _photoCamera = null;

             return true;
        }