title: C# SecuGen load back fingerprint image to verify
body: <p>I am currently using a biometric device name "SecuGen Hamster", I am able to capture the fingerprint image and save the image into local pc.</p>
  
  <p>But how can I load the image back and do the verification as the verification is done in real-time during the capture of the finger print.</p>
  
  <p>Here is the code I used to capture and save fingerprint image:</p>
  
  <pre><code>   private void BtnCapture1_Click(object sender, System.EventArgs e)
      {
          Int32 iError;
          Byte[] fp_image;
          Int32 img_qlty;
  
          fp_image = new Byte[m_ImageWidth * m_ImageHeight];
          img_qlty = 0;
  
          iError = m_FPM.GetImage(fp_image);
  
          m_FPM.GetImageQuality(m_ImageWidth, m_ImageHeight, fp_image, ref img_qlty);
          progressBar_R1.Value = img_qlty;
  
          if (iError == (Int32)SGFPMError.ERROR_NONE)
          {
              DrawImage(fp_image, pictureBoxR1);
              pictureBoxR1.Image.Save(@"D:\TEMP\LeftThumb.jpeg", ImageFormat.Jpeg);
  
              iError = m_FPM.CreateTemplate(fp_image, m_RegMin1);
  
              if (iError == (Int32)SGFPMError.ERROR_NONE)
                  StatusBar.Text = "First image is captured";
              else
                  DisplayError("CreateTemplate()", iError);
          }
          else
              DisplayError("GetImage()", iError);
      }
  </code></pre>
  
  <p>Here is how it verifies:</p>
  
  <pre><code>        /// MatchTemplate(), GetMatchingScore()
          private void BtnVerify_Click(object sender, System.EventArgs e)
          {
              Int32 iError;
              bool matched1 = false;
              bool matched2 = false;
              SGFPMSecurityLevel secu_level;
  
              secu_level = (SGFPMSecurityLevel)comboBoxSecuLevel_V.SelectedIndex;
  
              iError = m_FPM.MatchTemplate(m_RegMin1, m_VrfMin, secu_level, ref matched1);
              iError = m_FPM.MatchTemplate(m_RegMin2, m_VrfMin, secu_level, ref matched2);
  
              if (iError == (Int32)SGFPMError.ERROR_NONE)
              {
                  if(radioButton1.Checked == true){
  
                      if (matched1) //left
                          StatusBar.Text = "Left Thumb Verification Success";
                      else
                          StatusBar.Text = "Verification Failed";
                  }
                  else if (radioButton2.Checked == true)
                  {             
                      if (matched2) //right
                          StatusBar.Text = "Right Thumb Verification Success";
                      else
                          StatusBar.Text = "Verification Failed";
                  }
  
              }
              else
                  DisplayError("MatchTemplate()", iError);
          }
  </code></pre>
  
  <p>What I mean is when I browse the fingerprint image, can it convert the jpeg files to bytes and then verify it?</p>
  
  <p>Thanks</p>