예제 #1
0
        private void grFingerXCtrl_ImageAcquired(object sender, AxGrFingerXLib._IGrFingerXCtrlEvents_ImageAcquiredEvent e)
        {
            System.Drawing.Image handle = null;
            IntPtr hdc = GetDC(System.IntPtr.Zero);

            grFingerXCtrl.CapRawImageToHandle(ref e.rawImage, e.width, e.height,
                                              hdc.ToInt32(), ref handle);
            //pbFingerprint.Image = handle; //put the just added image in our picture box
            //pbFingerprint.Update();

            //set the parameters in the FingerprintOPFormUSerMgt class
            fingerprintOP.rawImage.img    = e.rawImage;
            fingerprintOP.rawImage.height = (int)e.height;
            fingerprintOP.rawImage.width  = (int)e.width;
            fingerprintOP.rawImage.Res    = e.res;

            //finally , we extract the template and try to validate de user
            fingerprintOP.extractTemplate();
            //bool matched = fingerprintOP.authenticate(comboNames.SelectedItem.ToString(), ds);
            //authenticate();

            if (action.Equals("timeAttendance"))
            {
                timeAttendanceData.onImageAcquired(handle, e.rawImage, (int)e.height, (int)e.width, e.res);//do the action related to the FormUserMgt
            }
            else
            {
                studentList.onImageAcquired(handle, e.rawImage, (int)e.height, (int)e.width, e.res);//do the action related to the FormUserMgt
            }
        }
예제 #2
0
 //  An image was acquired from reader
 private void axGrFingerXCtrl1_ImageAcquired(object sender, AxGrFingerXLib._IGrFingerXCtrlEvents_ImageAcquiredEvent e)
 {
     //  Copying aquired image
     myUtil._raw.height = e.height;
     myUtil._raw.width  = e.width;
     myUtil._raw.Res    = e.res;
     myUtil._raw.img    = e.rawImage;
     //  Signaling that an Image Event occurred.
     myUtil.WriteLog(("Sensor: "
                      + (e.idSensor + ". Event: Image captured.")));
     //  display fingerprint image
     myUtil.PrintBiometricDisplay(false, GRConstants.GR_DEFAULT_CONTEXT);
     // ---extract the template from the fingerprint scanned---
     ExtractTemplate();
     // ---identify who the user is---
     _UserID = IdentifyFingerprint();
     if ((_UserID > 0))
     {
         // ---user found---
         btnRegister.Enabled = false;
         GetUserInfo();
         // ---writes to log file---
         WriteToLog(_UserID.ToString());
     }
     else
     {
         // ---user not found---
         ClearDisplay();
         btnRegister.Enabled = true;
         lblMessage.Text     = "User not found! Please register your information below";
     }
 }