protected Fingerprint ProcessImage(System.Drawing.Image img, uint fingerPosition = 0, Dermalog.AFIS.FourprintSegmentation.HandPositions hand = Dermalog.AFIS.FourprintSegmentation.HandPositions.Unknown)
 {
     using (RawImage rawImage = RawImageHelperForms.FromBitmap(img as Bitmap))
     {
         return(ProcessImage(img, rawImage, fingerPosition, hand));
     }
 }
Ejemplo n.º 2
0
        private void Btn_Generate_Image_Click(object sender, EventArgs e)
        {
            try
            {
                _capDevice.CaptureMode = CaptureMode.LIVE_IMAGE;

                if (_capDevice != null && _capDevice.IsCapturing && _capDevice.CaptureMode == CaptureMode.LIVE_IMAGE)
                {
                    _capDevice.Freeze(true);
                    imageHolder.Image = _capDevice.GetImage();


                    if (imageHolder.Image != null)
                    {
                        Bitmap bitmap = (Bitmap)imageHolder.Image;

                        try
                        {
                            RawImage rawImage = RawImageHelperForms.FromBitmap(bitmap);
                            encoder.Format         = Dermalog.Afis.FingerCode3.Enums.TemplateFormat.ISO19794_2_2005;
                            encoder.ImpressionType = 0;
                            rightTemplate          = encoder.Encode(bitmap);

                            txtFingerPrintFormat.Text = rightTemplate.Format.ToString();


                            string covertedDataTemplate = BitConverter.ToString(rightTemplate.Data);

                            txtImageData.Text = covertedDataTemplate;
                            //txtImageData.Text = Encoding.UTF8.GetString(rightTemplate.Data);
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
            }
            catch (DeviceErrorException ex)
            {
                System.Diagnostics.Trace.WriteLine("An exception occurred while trying to generate image from scanner. Message - " + ex.Message + "|Stacktrace - " + ex.StackTrace);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine("An exception occurred while trying to generate image from scanner. Message - " + ex.Message + "|Stacktrace - " + ex.StackTrace);
            }
        }