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

            return(true);
        }
예제 #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();
            });
        }
예제 #3
0
파일: Scanner.xaml.cs 프로젝트: BlaiseV/OFF
        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();
            });
        }
예제 #4
0
파일: Scanner.xaml.cs 프로젝트: BlaiseV/OFF
        private bool stopCamera()
        {
            if (_photoCamera == null)
             {
            return false;
             }
             _timer.Stop();
             _timer = null;
             _luminance = null;
             _reader = null;
             _photoCamera.Dispose();
             _photoCamera = null;

             return true;
        }