GetTemplate

Get the fingerprint template, which is obtained most recently.

 

Ejemplo

C#

string sRegTemplate, sRegTemplate10;
int FPID = 0;
      
private void BeginEnroll()
        {
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.BeginEnroll();
        }
private void axZKFPEngX1_OnEnroll(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnEnrollEvent e)
        {
if (!e.actionResult)
            {
                MessageBox.Show("Register Failed!", "error!");
            }
else
            {
byte[] _byteRegTemplate=(byte[]) axZKFPEngX1.GetTemplate();
                sRegTemplate = axZKFPEngX1.GetTemplateAsStringEx("9");
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!");
                };
            }
        }
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_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);
        }

VB