Ejemplo n.º 1
0
        public ImageFrm()
        {
            InitializeComponent();
            m_DelegateSetImage      = new SetImageDelegate(this.SetImage);
            m_DelegateWriteResults  = new WriteResultsDelegate(this.WriteResults);
            m_CaptureThreadFinished = new DelegateCaptureThreadFinished(this.CaptureFinished);
            m_MatchThreadFinished   = new DelegateMatchThreadFinished(this.MatchFinished);
            m_CaptureWithPDFinished = new DelegateCaptureWithPDFinished(this.CaptureWithPDFinished);
            del = new LumiSDKWrapper.LumiAcqStatusCallbackDelegate(this.AcqStatusCallback);

            // Set PD Capture flag
            m_bPDCaptureInProcess = false;
            // Set Cancel Capture state
            m_bCancelCapture = false;

            try
            {
                // Open the scanner
                SDKBiometrics.OpenScanner();
                // Get Current Timeout
                LumiSDKWrapper.LUMI_CONFIG config = new LumiSDKWrapper.LUMI_CONFIG();
                SDKBiometrics.GetConfig(ref config);
                this.txtTriggerTimeout.Text = config.nTriggerTimeout.ToString();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "Error");
                DisableControls();
                return;
            }
        }
Ejemplo n.º 2
0
        public void Run()
        {
            try
            {
                uint width = 0, height = 0;

                SDKBiometrics.GetWidthAndHeight(ref width, ref height);

                byte[] snapShot24bpp = new byte[width * height * 3]; // multiply by 3 to get 24bppRgb format
                byte[] template      = new byte[5000];               //array to hold the template
                uint   templateLen   = 0;

                // Assign the main form's PresenceDetectionCallback method to the LumiPresenceDetectCallbackDelegate
                LumiSDKWrapper.LumiPresenceDetectCallbackDelegate del = new LumiSDKWrapper.LumiPresenceDetectCallbackDelegate(m_form.PresenceDetectionCallback);

                SDKBiometrics.LumiCaptureWithPresenceDetectionFeedback(snapShot24bpp, template, ref templateLen, width, height, del);

                m_form.Invoke(m_form.m_DelegateSetImage, new object[] { snapShot24bpp, (uint)width, (uint)height });
                GC.KeepAlive(del);

                m_form.Invoke(m_form.m_DelegateWriteResults, new object[] { (SDKBiometrics.StatusMessage) });
            }
            catch (Exception err)
            {
                m_form.Invoke(m_form.m_DelegateWriteResults, new object[] { (err.ToString()) });
            }

            m_form.Invoke(m_form.m_CaptureWithPDFinished, null);
        }
Ejemplo n.º 3
0
 private void ChangeTimeout_Click(object sender, EventArgs e)
 {
     // NOTE: The trigger timeout will not be set on the device until a
     // command that directly interacts with the sensor is called.  In the
     // case of this CSharp example, either the capture or match commands
     // will suffice.
     LumiSDKWrapper.LUMI_CONFIG config = new LumiSDKWrapper.LUMI_CONFIG();
     SDKBiometrics.GetConfig(ref config);
     config.nTriggerTimeout = uint.Parse(this.txtTriggerTimeout.Text);
     SDKBiometrics.SetConfig(config);
     SDKBiometrics.GetConfig(ref config);
     this.txtTriggerTimeout.Text = config.nTriggerTimeout.ToString();
 }
Ejemplo n.º 4
0
        // Match with preview image
        private void Match_Click(object sender, EventArgs e)
        {
            // Check to see if we can do a template extract and match
            try
            {
                if (!SDKBiometrics.ExtractTemplateAvailable())
                {
                    WriteResults("ERROR: The sensor is not configured to extract or match templates.\r\n");
                    return;
                }
            }
            catch (Exception err)
            {
                WriteResults(err.ToString());
                return;
            }

            DisableControls();
            m_MatchThread      = new Thread(new ThreadStart(this.MatchThreadFuction));
            m_MatchThread.Name = "MatchThread";
            m_MatchThread.Start();
        }
Ejemplo n.º 5
0
 private void btnTestAPI_Click(object sender, EventArgs e)
 {
     SDKBiometrics.TestAPI(this);
     lumiPictureBox.Image = null;
 }
Ejemplo n.º 6
0
 private void ImageFrm_FormClosing(object sender, FormClosingEventArgs e)
 {
     // Close the scanner
     SDKBiometrics.CloseScanner();
 }