public Bitmap ConvertSampleToBitmap(DPFP.Sample Sample) { DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion(); Bitmap bitmap = null; Convertor.ConvertToPicture(Sample, ref bitmap); return bitmap; }
public static Bitmap ConvertSampleToBitmap(DPFP.Sample Sample) { DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion(); // Create a sample convertor. Bitmap bitmap = null; // TODO: the size doesn't matter Convertor.ConvertToPicture(Sample, ref bitmap); // TODO: return bitmap as a result return bitmap; }
protected Bitmap ConvertSampleToBitmap(DPFP.Sample Sample) { DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion(); Bitmap bitmap = null; Convertor.ConvertToPicture(Sample, ref bitmap); return(bitmap); }
protected Bitmap ConvertSampleToBitmap(DPFP.Sample Sample) { DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion(); // Create a sample convertor. Bitmap bitmap = null; // TODO: the size doesn't matter Convertor.ConvertToPicture(Sample, ref bitmap); // TODO: return bitmap as a result return(bitmap); }
public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample) { sp.ConvertToPicture(Sample, ref img); pictureBox1.Image = img; if (type == "enroll") { enroll(Sample); } else if (type.Contains("web-verify")) { verify(Sample); } }
public Bitmap ConvertSampleToBitmapLogin(DPFP.Sample Sample) { try { DPFP.Capture.SampleConversion Convertor = new DPFP.Capture.SampleConversion(); Bitmap bitmap = null; Convertor.ConvertToPicture(Sample, ref bitmap); return(bitmap); } catch (Exception ex) { LogError.AddExcFileTxt(ex, "LectorHuella ~ OnTemplate"); return(null); } }
public void OnComplete(object obj, string info, DPFP.Sample sample) { this.Invoke(new Functionz(delegate() { textBox1.Text = "Captura Completa"; })); this.Invoke(new Functionz(delegate() { Bitmap tempRef = null; converter.ConvertToPicture(sample, ref tempRef); System.Drawing.Image img = tempRef; Bitmap bmp = new Bitmap(converter.ConvertToPicture(sample, ref tempRef), pbImage.Size); String pxFormat = bmp.PixelFormat.ToString(); Point txtLoc = new Point(pbImage.Width / 2 - 20, 0); graphics = Graphics.FromImage(bmp); if (registrationInProgress) { try { regFeatures[0] = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment); regFeatures[1] = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment); regFeatures[2] = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment); regFeatures[3] = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment); if (regFeatures[0] != null) { string b64 = Convert.ToBase64String(regFeatures[0].Bytes); regFeatures[0].DeSerialize(Convert.FromBase64String(b64)); if (regFeatures[0] == null) { txtLoc.X = pbImage.Width / 2 - 26; graphics.DrawString("Error", font, Brushes.Cyan, txtLoc); return; } createRegTemplate.AddFeatures(regFeatures[0]); createRegTemplate.AddFeatures(regFeatures[1]); createRegTemplate.AddFeatures(regFeatures[2]); createRegTemplate.AddFeatures(regFeatures[3]); graphics = Graphics.FromImage(bmp); graphics.DrawString("" + 0 + " De 4", font, Brushes.Black, txtLoc); if (createRegTemplate.TemplateStatus == DPFP.Processing.Enrollment.Status.Failed) { capturer.StopCapture(); MessageBox.Show("Error en la captura"); } else if (createRegTemplate.TemplateStatus == DPFP.Processing.Enrollment.Status.Ready) { string mensaje = ""; MemoryStream x = new MemoryStream(); MemoryStream mem = new MemoryStream(); template = createRegTemplate.Template; template.Serialize(mem); verFeatures = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Verification); mensaje = comparar(verFeatures); if (mensaje == "Huella registrada") { MessageBox.Show(mensaje, "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { textBox1.Text = ""; MessageBox.Show("Huella no registrada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } catch (DPFP.Error.SDKException ex) { MessageBox.Show(ex.Message); } } pbImage.Image = bmp; })); }
public void OnComplete(object obj, string info, DPFP.Sample sample) { this.Invoke(new Functionz(delegate() { tbInfo.Text = "Captura Completa"; })); this.Invoke(new Functionz(delegate() { Bitmap tempRef = null; converter.ConvertToPicture(sample, ref tempRef); System.Drawing.Image img = tempRef; Bitmap bmp = new Bitmap(converter.ConvertToPicture(sample, ref tempRef), pbImage.Size); String pxFormat = bmp.PixelFormat.ToString(); Point txtLoc = new Point(pbImage.Width / 2 - 20, 0); graphics = Graphics.FromImage(bmp); if (registrationInProgress) { try { regFeatures[fingerCount] = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Enrollment); if (regFeatures[fingerCount] != null) { string b64 = Convert.ToBase64String(regFeatures[fingerCount].Bytes); regFeatures[fingerCount].DeSerialize(Convert.FromBase64String(b64)); if (regFeatures[fingerCount] == null) { txtLoc.X = pbImage.Width / 2 - 26; graphics.DrawString("Bad Press", font, Brushes.Cyan, txtLoc); return; } ++fingerCount; createRegTemplate.AddFeatures(regFeatures[fingerCount - 1]); graphics = Graphics.FromImage(bmp); if (fingerCount < 4) { graphics.DrawString("" + fingerCount + " De 4", font, Brushes.Black, txtLoc); } if (createRegTemplate.TemplateStatus == DPFP.Processing.Enrollment.Status.Failed) { capturer.StopCapture(); fingerCount = 0; MessageBox.Show("Registration Failed, \nMake sure you use the same finger for all 4 presses."); } else if (createRegTemplate.TemplateStatus == DPFP.Processing.Enrollment.Status.Ready) { string mensaje = ""; MemoryStream x = new MemoryStream(); MemoryStream mem = new MemoryStream(); template = createRegTemplate.Template; template.Serialize(mem); verFeatures = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Verification); mensaje = ""; //comparar(verFeatures); if (mensaje == "Ya Existe un Empleado Con LaHuella Capturada") { MessageBox.Show(mensaje, "Seguridad NuevaEra", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); capturer.StopCapture(); this.Close(); } else { MessageBox.Show("Captura Completa", "Seguridad Nueva Era", MessageBoxButtons.OK, MessageBoxIcon.Information); huella = mem.GetBuffer(); capturer.StopCapture(); } } } } catch (DPFP.Error.SDKException ex) { MessageBox.Show(ex.Message); } } else { DPFP.Verification.Verification.Result rslt = new DPFP.Verification.Verification.Result(); verFeatures = ExtractFeatures(sample, DPFP.Processing.DataPurpose.Verification); verify.Verify(verFeatures, template, ref rslt); txtLoc.X = pbImage.Width / 2 - 38; if (rslt.Verified == true) { graphics.DrawString("Match!!!!", font, Brushes.LightGreen, txtLoc); } else { graphics.DrawString("No Match!!!", font, Brushes.Red, txtLoc); } } pbImage.Image = bmp; })); }