Exemple #1
0
        private void StartCapturing()
        {
            //NFingerScanner scanner = scannersListBox.SelectedItem as NFingerScanner;
            var scanner = (NFingerScanner)_deviceMan.Devices[1];

            if (scanner == null)
            {
                MessageBox.Show(@"Please select a scanner from the list.");
                return;
            }

            if (scanWorker.IsBusy)
            {
                MessageBox.Show(@"Scan already in progress.");
                return;
            }
            scanWorker.RunWorkerAsync(_currentScanner);

            // Create a finger
            _subjectFinger = new NFinger();

            // Add finger to the subject and fingerView
            _subject = new NSubject();
            _subject.Fingers.Add(_subjectFinger);
            _subjectFinger.PropertyChanged += OnAttributesPropertyChanged;
            _nfView.Finger     = _subjectFinger;
            _nfView.ShownImage = ShownImage.Original;

            // Begin capturing
            _biometricClient.FingersReturnBinarizedImage = true;
            var task = _biometricClient.CreateTask(NBiometricOperations.Capture | NBiometricOperations.CreateTemplate, _subject);

            _biometricClient.BeginPerformTask(task, OnEnrollCompleted, null);
        }