示例#1
0
        private void CaptureDataFingerpint(int message)
        {
            switch (message)
            {
            case MESSAGE_CAPTURED_OK:
            {
                MemoryStream ms = new MemoryStream();
                BitmapFormat.GetBitmap(FPBuffer, mfpWidth, mfpHeight, ref ms);
                Bitmap bmp = new Bitmap(ms);

                // set image to Scan Finger's Form
                scanFinger.SetImage(bmp);

                String strShow = zkfp2.BlobToBase64(CapTmp, cbCapTmp);
                scanFinger.DataFinger       = strShow;
                scanFinger.DataFingerLength = strShow.Length;
                Console.WriteLine(strShow);

                // set quality finger
                string present_quality_finger = tk.CalculatePercentageTemplateFingerprint(strShow.Length);
                scanFinger.SetPresentQuality(present_quality_finger);
            }
            break;

            default:
                Console.WriteLine("Error : Invalid Data Fingerprint.");
                break;
            }
        }
        public ScanFinger(FormRegister register, int EmployeeID, int IndexFinger, int templateLength)
        {
            InitializeComponent();
            tk = new TKHelper();
            db = new DB();
            btnStart.Enabled          = false;
            this.EmployeeID           = EmployeeID;
            this.IndexFinger          = IndexFinger;
            this.templateLength       = templateLength;
            this.DataFinger           = "";
            this.register             = register;
            labelPreviousQuality.Text = tk.CalculatePercentageTemplateFingerprint(templateLength);
            string fingerType = GetFingerType(this.IndexFinger);

            txtFinger.Text = "Type : " + fingerType;
            device         = new Device(this);
        }