///////////////////////////////////// private void BtnRegister_Click(object sender, System.EventArgs e) { bool matched = false; Int32 err = 0; err = m_FPM.MatchTemplate(m_RegMin1, m_RegMin2, m_SecurityLevel, ref matched); if ((err == (Int32)SGFPMError.ERROR_NONE)) { if (matched) { // Save template after merging two template - m_FetBuf1, m_FetBuf2 Byte[] merged_template; Int32 buf_size = 0; if (m_useAnsiTemplate) { m_FPM.GetTemplateSizeAfterMerge(m_RegMin1, m_RegMin2, ref buf_size); merged_template = new Byte[buf_size]; m_FPM.MergeAnsiTemplate(m_RegMin1, m_RegMin2, merged_template); } else { m_FPM.GetIsoTemplateSizeAfterMerge(m_RegMin1, m_RegMin2, ref buf_size); merged_template = new Byte[buf_size]; m_FPM.MergeIsoTemplate(m_RegMin1, m_RegMin2, merged_template); } if (m_StoredTemplate == null) { m_StoredTemplate = new Byte[buf_size]; merged_template.CopyTo(m_StoredTemplate, 0); } else { Int32 new_size = 0; if (m_useAnsiTemplate) { err = m_FPM.GetTemplateSizeAfterMerge(m_StoredTemplate, merged_template, ref new_size); } else { err = m_FPM.GetIsoTemplateSizeAfterMerge(m_StoredTemplate, merged_template, ref new_size); } Byte[] new_enroll_template = new Byte[new_size]; if (m_useAnsiTemplate) { err = m_FPM.MergeAnsiTemplate(merged_template, m_StoredTemplate, new_enroll_template); } else { err = m_FPM.MergeIsoTemplate(merged_template, m_StoredTemplate, new_enroll_template); } m_StoredTemplate = new Byte[new_size]; new_enroll_template.CopyTo(m_StoredTemplate, 0); } // Let's display ANSI/ISO template Info for (int i = 0; i < m_RadioButton.Length; i++) { m_RadioButton[i].Checked = false; } if (m_useAnsiTemplate) { SGFPMANSITemplateInfo sample_info = new SGFPMANSITemplateInfo(); err = m_FPM.GetAnsiTemplateInfo(m_StoredTemplate, sample_info); for (int i = 0; i < sample_info.TotalSamples; i++) { m_RadioButton[(Int32)sample_info.SampleInfo[i].FingerNumber].Checked = true; } } else { SGFPMISOTemplateInfo sample_info = new SGFPMISOTemplateInfo(); err = m_FPM.GetIsoTemplateInfo(m_StoredTemplate, sample_info); for (int i = 0; i < sample_info.TotalSamples; i++) { m_RadioButton[(Int32)sample_info.SampleInfo[i].FingerNumber].Checked = true; } } StatusBar.Text = "Template registration success"; } else { StatusBar.Text = "Template registration failed"; } } else { StatusBar.Text = "MatchTemplate() Error: " + err; } }