void refFingercore_onImage(object source, GriauleFingerprintLibrary.Events.ImageEventArgs ie)
        {
            rawImage = ie.RawImage;
            SetImage(ie.RawImage.Image);
            stepCount++;
            //ExtractTemplate();

            try
            {
                _template = new GriauleFingerprintLibrary.DataTypes.FingerprintTemplate();
                int ret = (int)refFingercore.Enroll(ie.RawImage, ref _template, GrTemplateFormat.GR_FORMAT_DEFAULT, FingerprintConstants.GR_DEFAULT_CONTEXT);
                if (ret >= FingerprintConstants.GR_ENROLL_SUFFICIENT)
                {
                    //IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);
                    //dl.SaveTemplate(template);

                    if (ret == FingerprintConstants.GR_ENROLL_SUFFICIENT)
                    {
                        SetStatusMessage("Sufficient quality value.");
                        PerformStep(QualityTemplate.SUF, Color.YellowGreen);
                    }
                    else if (ret == FingerprintConstants.GR_ENROLL_GOOD)
                    {
                        SetStatusMessage("Good quality value.");
                        PerformStep(QualityTemplate.GOOD, Color.MediumSeaGreen);
                    }
                    else if (ret == FingerprintConstants.GR_ENROLL_VERY_GOOD)
                    {
                        IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);
                        dl.SaveTemplate(_template);

                        PerformStep(QualityTemplate.VERYGOOD, Color.SeaGreen);

                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }
                    else if (ret == FingerprintConstants.GR_ENROLL_MAX_LIMIT_REACHED)
                    {
                        IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);
                        dl.SaveTemplate(_template);

                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }

                    EnableOk();
                }
                else
                {
                    // WriteLog("The Template does not reach a good quality value");
                    SetStatusMessage("Please put your finger again");
                    PerformStep(QualityTemplate.INSF, Color.LightCoral);
                }
            }
            catch { }


            System.Threading.Thread.Sleep(100);
        }
Exemple #2
0
 private void enrollToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     try
     {
         if (_template == null)
         {
             MessageBox.Show("Error, Null template");
             return;
         }
         IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);
         dl.SaveTemplate(_template);
     }
     catch { }
 }
        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);
                dl.SaveTemplate(_template);

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch
            {
                this.DialogResult = DialogResult.Abort;
                this.Close();
            }
        }