OnEnrollToFile

Call this event when the user fingerprint registration completes. ActionResult =true indicates that the registration is successful, and the fingerprint feature template is saved in a file, whose name is set as the property RegTplFileName; False represents a failure

 

Ejemplo

C#

 AxZKFPEngX axZKFPEngX1 = new AxZKFPEngX();
int fpcHandle;
int FPID = 0;
string sRegTemplate, sRegTemplate10;
private void BeginEnroll()
        {
            axZKFPEngX1.CreateControl();
if (axZKFPEngX1.InitEngine() == 0)
            {
                axZKFPEngX1.FPEngineVersion = "9";//"10"
                fpcHandle = axZKFPEngX1.CreateFPCacheDBEx();
if (axZKFPEngX1.IsRegister)
                {
                    axZKFPEngX1.CancelEnroll();
                }
                axZKFPEngX1.EnrollCount = 3;
                axZKFPEngX1.OnImageReceived += new AxZKFPEngXControl.IZKFPEngXEvents_OnImageReceivedEventHandler(axZKFPEngX1_OnImageReceived);
                axZKFPEngX1.OnFeatureInfo += new AxZKFPEngXControl.IZKFPEngXEvents_OnFeatureInfoEventHandler(axZKFPEngX1_OnFeatureInfo);
                axZKFPEngX1.OnEnroll += new AxZKFPEngXControl.IZKFPEngXEvents_OnEnrollEventHandler(axZKFPEngX1_OnEnroll);
                axZKFPEngX1.OnEnrollToFile += new AxZKFPEngXControl.IZKFPEngXEvents_OnEnrollToFileEventHandler(axZKFPEngX1_OnEnrollToFile);
                axZKFPEngX1.BeginEnroll();
            }
else
            {
                axZKFPEngX1.EndEngine();
                MessageBox.Show("Initial Failed!", "Error");
            }
        }
private void axZKFPEngX1_OnImageReceived(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnImageReceivedEvent e)
        {
            PictureBox pictureBox1 = new PictureBox();
            pictureBox1.BackColor = System.Drawing.SystemColors.ButtonFace;
            pictureBox1.Location = new System.Drawing.Point(18, 20);
            pictureBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            pictureBox1.Size = new System.Drawing.Size(411, 572);
            pictureBox1.TabIndex = 11;
            pictureBox1.TabStop = false;
            Graphics g = pictureBox1.CreateGraphics();
int dc = g.GetHdc().ToInt32();
            axZKFPEngX1.PrintImageAt(dc, 0, 0, axZKFPEngX1.ImageWidth, axZKFPEngX1.ImageHeight);
        }
private void axZKFPEngX1_OnFeatureInfo(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnFeatureInfoEvent e)
        {
string sTemp = "";
if (axZKFPEngX1.IsRegister)
                sTemp = "Register status: still press finger " + axZKFPEngX1.EnrollIndex.ToString() + " times!";
            sTemp = sTemp + " Fingerprint quality";
int lastq = axZKFPEngX1.LastQuality;
if (e.aQuality == -1)
                sTemp = sTemp + " not good, Suspicious fingerprints, quality=" + lastq.ToString();
else if (e.aQuality != 0)
                sTemp = sTemp + " not good, quality=" + lastq.ToString();
else
                sTemp = sTemp + " good, quality=" + lastq.ToString();
        }
private void axZKFPEngX1_OnEnrollToFile(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnEnrollToFileEvent e)
        {
            MessageBox.Show("axZKFPEngX1_OnEnrollToFile");
        }
private void axZKFPEngX1_OnEnroll(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnEnrollEvent e)
        {
if (!e.actionResult)
            {
                MessageBox.Show("Register Failed!", "error!");
            }
else
            {
                sRegTemplate = axZKFPEngX1.GetTemplateAsStringEx("9");
                sRegTemplate10 = axZKFPEngX1.GetTemplateAsStringEx("10");
if (sRegTemplate.Length > 0)
                {
if (sRegTemplate10.Length > 0)
                        axZKFPEngX1.AddRegTemplateStrToFPCacheDBEx(fpcHandle, FPID, sRegTemplate, sRegTemplate10);
else
                        MessageBox.Show("Register 10.0 failed, template length is zero", "error!");
object pTemplate;
                     
                        pTemplate = axZKFPEngX1.DecodeTemplate1(sRegTemplate);
                    
// Note: 10.0Template can not be compressed (±»Ñ¹Ëõ)
                    axZKFPEngX1.SetTemplateLen(ref pTemplate, 602);
                    axZKFPEngX1.SaveTemplate("fingerprint.tpl", pTemplate);
                    FPID++;
                    MessageBox.Show("Register Succeed", "Information!");
                }
else
                {
                    MessageBox.Show("Register Failed, template length is zero", "error!");
                };
            }
        }

VB

Private Sub OnFingerLeaving()
        axZKFPEngX1.CreateControl()
If axZKFPEngX1.InitEngine() = 0 Then
            axZKFPEngX1.FPEngineVersion = "9"
'"10"
            fpcHandle = axZKFPEngX1.CreateFPCacheDBEx()
AddHandler axZKFPEngX1.OnFingerLeaving, AddressOf axZKFPEngX1_OnFingerLeaving
Else
            axZKFPEngX1.EndEngine()
            MessageBox.Show("Initial Failed!", "Error")
End If
End Sub
Private Sub axZKFPEngX1_OnFingerLeaving(sender As Object, e As EventArgs)
        MessageBox.Show("OnFingerLeaving")
End Sub