public String CapturarDigitaisParaInscricao()
        {
            try
            {
                NBioAPI.Type.HFIR template = new NBioAPI.Type.HFIR();

                uint retorno = api.Enroll(out template, null);

                if (retorno == NBioAPI.Error.NONE)
                {
                    NBioAPI.Type.FIR_TEXTENCODE binario = new NBioAPI.Type.FIR_TEXTENCODE();
                    api.GetTextFIRFromHandle(template, out binario, false);
                    return(binario.TextFIR);
                }
                else
                {
                    Console.WriteLine(retorno);
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Erro ao capturar as digitais.", ex);
            }
        }
        //verifica o formato a importar e converte para formato nitgen.
        private void Button2_Click(object sender, EventArgs e)
        {
            if (rb_hv01.Checked)
            {
                importType = NBioAPI.Type.MINCONV_DATA_TYPE.MINCONV_TYPE_FIM01_HV;
            }
            else if (rb_ISO.Checked)
            {
                importType = NBioAPI.Type.MINCONV_DATA_TYPE.MINCONV_TYPE_ISO;
            }


            try
            {
                m_Export.FDxToNBioBSPEx(minData, nSize, importType, NBioAPI.Type.FIR_PURPOSE.VERIFY, out processedFIR);
            }
            catch (Exception)
            {
                String error = "Formato incompatível ";
                MessageBox.Show(error);
                return;
            }

            NBioAPI.Type.FIR_TEXTENCODE textencode;
            nBioAPI.GetTextFIRFromHandle(processedFIR, out textencode, true);
            txt_textencode.Text = textencode.TextFIR;
            MessageBox.Show("Convertido com Sucesso");
        }
Beispiel #3
0
        //recebe HFIR e retorna TEXTENCODE
        public NBioAPI.Type.FIR_TEXTENCODE Fir_to_TextEncode(NBioAPI.Type.HFIR hfir)
        {
            NBioAPI.Type.FIR_TEXTENCODE txtencode = new NBioAPI.Type.FIR_TEXTENCODE();
            m_NBioAPI.GetTextFIRFromHandle(hfir, out txtencode, true);

            return(txtencode);
        }
Beispiel #4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            m_WinOption.WindowStyle = NBioAPI.Type.WINDOW_STYLE.INVISIBLE;
            retorno_para_exportar   = new NBioAPI.Type.HFIR();
            m_hNewFIR = new NBioAPI.Type.HFIR();
            m_NBioAPI.OpenDevice(255);
            uint ret = m_NBioAPI.Capture(NBioAPI.Type.FIR_PURPOSE.VERIFY, out m_hNewFIR, -1, retorno_para_exportar, m_WinOption);

            m_NBioAPI.GetTextFIRFromHandle(m_hNewFIR, out m_textFIR, true);
            Console.WriteLine("texto com m_new1 " + m_textFIR.TextFIR);
            m_textFIR = null;
            m_NBioAPI.GetTextFIRFromHandle(retorno_para_exportar, out m_textFIR, true);
            Console.WriteLine("text com retorno com retorno_para_exportar " + m_textFIR.TextFIR);
            bmp          = utils.Conversor(m_textFIR);
            ptb_fp.Image = bmp;
        }
Beispiel #5
0
        public string Capturar()
        {
            NBioAPI.Type.HFIR           hCapturedFIR      = new NBioAPI.Type.HFIR();
            NBioAPI.Type.HFIR           hCapturedFIRaudit = new NBioAPI.Type.HFIR();
            NBioAPI.Type.FIR_TEXTENCODE texto             = new NBioAPI.Type.FIR_TEXTENCODE();
            //Get FIR data
            uint device = m_NBioAPI.OpenDevice(255);

            if (device != NBioAPI.Error.NONE)
            {
                return(null);
            }
            m_NBioAPI.Capture(NBioAPI.Type.FIR_PURPOSE.VERIFY, out hCapturedFIR, -1, hCapturedFIRaudit, null);
            m_NBioAPI.GetTextFIRFromHandle(hCapturedFIR, out texto, true);
            m_NBioAPI.CloseDevice(255);
            return(texto.TextFIR);
        }
        private void buttonAdv1_Click(object sender, EventArgs e)
        {
            LeitorBiometrico leitor = new LeitorBiometrico();

            NBioAPI.Type.HFIR           teste = leitor.Capturar();
            NBioAPI.Type.FIR_TEXTENCODE teste2;
            NBioAPI m_NBioAPI = new NBioAPI();

            m_NBioAPI.GetTextFIRFromHandle(teste, out teste2, true);
            string teste3 = teste2.TextFIR;

            MessageBox.Show(teste3);
        }
        public string Identificar(string Digital)
        {
            NBioAPI m_NBioAPI = new NBioAPI();

            NBioAPI.Type.FIR_TEXTENCODE m_textFIR = new NBioAPI.Type.FIR_TEXTENCODE();
            //NBioAPI.Type.HFIR NewFIR;
            NBioAPI.IndexSearch           m_IndexSearch = new NBioAPI.IndexSearch(m_NBioAPI);
            NBioAPI.Type.HFIR             hCapturedFIR;
            NBioAPI.IndexSearch.FP_INFO[] fpInfo;


            NBioAPI.Type.WINDOW_OPTION m_WinOption = new NBioAPI.Type.WINDOW_OPTION();
            m_WinOption.WindowStyle = (uint)NBioAPI.Type.WINDOW_STYLE.NO_WELCOME;

            uint ID = 1;

            m_textFIR.TextFIR = Digital;
            m_IndexSearch.AddFIR(m_textFIR, ID, out fpInfo);

            uint dataCount;

            m_IndexSearch.GetDataCount(out dataCount);

            m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);
            uint ret = m_NBioAPI.Capture(out hCapturedFIR);

            if (ret != NBioAPI.Error.NONE)
            {
                //DisplayErrorMsg(ret);
                m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
                m_NBioAPI.GetTextFIRFromHandle(hCapturedFIR, out m_textFIR, true);
            }

            m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);


            NBioAPI.IndexSearch.FP_INFO         fpInfo2;
            NBioAPI.IndexSearch.CALLBACK_INFO_0 cbInfo0 = new NBioAPI.IndexSearch.CALLBACK_INFO_0();
            cbInfo0.CallBackFunction = new NBioAPI.IndexSearch.INDEXSEARCH_CALLBACK(myCallback);

            // Identify FIR to IndexSearch DB
            ret = m_IndexSearch.IdentifyData(hCapturedFIR, NBioAPI.Type.FIR_SECURITY_LEVEL.NORMAL, out fpInfo2, cbInfo0);
            if (ret != NBioAPI.Error.NONE)
            {
                //DisplayErrorMsg(ret);
                //return fpInfo2.ID.ToString();
                return(m_textFIR.TextFIR);
            }

            return("");
        }
        public string Capturar()
        {
            NBioAPI m_NBioAPI = new NBioAPI();

            NBioAPI.Type.HFIR           hCapturedFIR = new NBioAPI.Type.HFIR();
            NBioAPI.Type.FIR_TEXTENCODE texto        = new NBioAPI.Type.FIR_TEXTENCODE();
            // Get FIR data

            m_NBioAPI.OpenDevice(255);

            m_NBioAPI.Capture(out hCapturedFIR);
            m_NBioAPI.GetTextFIRFromHandle(hCapturedFIR, out texto, true);


            return(texto.TextFIR);
        }
        //Ativa leitor pra cadastrar a digital
        private void cadastraDigital()
        {
            uint ret5 = m_NBioAPI.Enroll(out m_hNewFIR, null);

            if (ret5 == NBioAPI.Error.NONE)
            {
                MessageBox.Show("Digital cadastrada com sucesso");
                //Converter FIR capturada para textoFIR
                m_NBioAPI.GetTextFIRFromHandle(m_hNewFIR, out m_textFIR, true);
                //Coloca o texto obtido na String para guardar no banco.
                firDigital = m_textFIR.TextFIR;
                //Joga a FIR no TextBox (Apenas para visualização
                digitalTextBox.Text = firDigital;
                //MessageBox.Show(codigo.ToString());
            }
        }
        //Ativa leitor pra cadastrar a digital
        //return Template da digital capturada.
        public String cadastraDigital()
        {
            abreDispositivo();
            //Aciona método para chamar a dll traduzida da janela de coleta da digital.
            mudaSkin();
            //Método que faz a captura da digitasl.
            uint ret5 = m_NBioAPI.Enroll(null, out m_hNewFIR, null, NBioAPI.Type.TIMEOUT.DEFAULT, null, m_WinOption);

            if (ret5 == NBioAPI.Error.NONE)
            {
                //Converter FIR capturada para textoFIR
                m_NBioAPI.GetTextFIRFromHandle(m_hNewFIR, out m_textFIR, true);
                //Coloca o texto obtido na String para guardar no banco.
                firDigital = m_textFIR.TextFIR;
                fechaDispositivo();
                return(firDigital);
            }
            //Retorna nulo, caso de algum erro no meio do processo.
            return(null);
        }
        public string Enroll(int id)
        {
            NBioAPI m_NBioAPI = new NBioAPI();

            NBioAPI.Type.FIR_TEXTENCODE m_textFIR;
            NBioAPI.Type.HFIR           NewFIR;
            NBioAPI.IndexSearch         m_IndexSearch = new NBioAPI.IndexSearch(m_NBioAPI);


            NBioAPI.Type.WINDOW_OPTION m_WinOption = new NBioAPI.Type.WINDOW_OPTION();
            m_WinOption.WindowStyle = (uint)NBioAPI.Type.WINDOW_STYLE.NO_WELCOME;

            string Retorno = "";

            m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);
            uint ret = m_NBioAPI.Enroll(out NewFIR, null);

            //uint ret = m_NBioAPI.Enroll(null, out NewFIR, null, NBioAPI.Type.TIMEOUT.DEFAULT, null, m_WinOption);


            if (ret != NBioAPI.Error.NONE)
            {
                m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
            }

            if (NewFIR != null)
            {
                m_NBioAPI.GetTextFIRFromHandle(NewFIR, out m_textFIR, true);


                if (m_textFIR.TextFIR != null)
                {
                    m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
                    Retorno = m_textFIR.TextFIR.ToString();
                }
            }
            return(Retorno);
        }
        public string Capturar(int id)
        {
            NBioAPI m_NBioAPI = new NBioAPI();

            NBioAPI.Type.INIT_INFO_0 initInfo0;
            uint ret = m_NBioAPI.GetInitInfo(out initInfo0);

            if (ret == NBioAPI.Error.NONE)
            {
                initInfo0.EnrollImageQuality = Convert.ToUInt32(50);
                initInfo0.VerifyImageQuality = Convert.ToUInt32(30);
                initInfo0.DefaultTimeout     = Convert.ToUInt32(10000);
                initInfo0.SecurityLevel      = (int)NBioAPI.Type.FIR_SECURITY_LEVEL.NORMAL - 1;
            }

            NBioAPI.IndexSearch         m_IndexSearch = new NBioAPI.IndexSearch(m_NBioAPI);
            NBioAPI.Type.HFIR           hCapturedFIR;
            NBioAPI.Type.FIR_TEXTENCODE texto;
            // Get FIR data
            m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);
            m_NBioAPI.Capture(out hCapturedFIR);

            try
            {
                if (hCapturedFIR != null)
                {
                    m_NBioAPI.GetTextFIRFromHandle(hCapturedFIR, out texto, true);
                    return(texto.TextFIR);
                }
                return(null);
            }
            catch (Exception ex)
            {
                throw new Exception("ERRO:... " + ex.Message);
            }
        }
Beispiel #13
0
        public void Capture(short Dispositivo, PictureBox Pct, Label labelImgQuality, Label LblFinalizacaoSelecionado, TipoDedo Dedo, TipoMao Mao, out NBioAPI.Type.FIR MyFir, out NBioAPI.Type.FIR_TEXTENCODE textFIR, bool Infinito)
        {
            LabelQualidadeSelecionado   = labelImgQuality;
            LabelFinalizacaoSelecionado = LblFinalizacaoSelecionado;

            m_WinOption.WindowStyle            = NBioAPI.Type.WINDOW_STYLE.INVISIBLE;
            m_WinOption.Option2.FPForeColor[0] = Convert.ToByte("00", 16);
            m_WinOption.Option2.FPForeColor[1] = Convert.ToByte("00", 16);
            m_WinOption.Option2.FPForeColor[2] = Convert.ToByte("00", 16);
            m_WinOption.Option2.FPBackColor[0] = Convert.ToByte("FF", 16);
            m_WinOption.Option2.FPBackColor[1] = Convert.ToByte("FF", 16);
            m_WinOption.Option2.FPBackColor[2] = Convert.ToByte("FF", 16);


            m_WinOption.FingerWnd = (uint)Pct.Handle.ToInt32();


            // Callback funtion
            m_WinOption.CaptureCallBackInfo = new NBioAPI.Type.CALLBACK_INFO_0();
            m_WinOption.CaptureCallBackInfo.CallBackFunction = new NBioAPI.Type.WINDOW_CALLBACK_0(MyCaptureCallback);
            m_WinOption.FinishCallBackInfo = new NBioAPI.Type.CALLBACK_INFO_1();
            m_WinOption.FinishCallBackInfo.CallBackFunction = new NBioAPI.Type.WINDOW_CALLBACK_1(MyFinishCallback);


            // Select finger for enrollment
            if (Mao == Biometria.TipoMao.Direita)
            {
                m_WinOption.Option2.DisableFingerForEnroll[0] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[1] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[2] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[3] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[4] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[5] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[6] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[7] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[8] = (byte)NBioAPI.Type.TRUE;
                m_WinOption.Option2.DisableFingerForEnroll[9] = (byte)NBioAPI.Type.TRUE;

                switch (Dedo)
                {
                case Biometria.TipoDedo.Anelar:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[3] = NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Indicador:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[1] = NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Médio:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[2] = (byte)NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Mínimo:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[4] = NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Polegar:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[0] = NBioAPI.Type.FALSE;
                    break;
                }
                }
            }
            else
            {
                switch (Dedo)
                {
                case Biometria.TipoDedo.Anelar:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[8] = NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Indicador:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[6] = NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Médio:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[7] = (byte)NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Mínimo:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[9] = NBioAPI.Type.FALSE;
                    break;
                }

                case Biometria.TipoDedo.Polegar:
                {
                    m_WinOption.Option2.DisableFingerForEnroll[5] = NBioAPI.Type.FALSE;
                    break;
                }
                }
            }

            NBioAPI.Type.HFIR hCapturedFIR;
            m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);
            if (Infinito)
            {
                m_NBioAPI.Capture(out hCapturedFIR, NBioAPI.Type.TIMEOUT.INFINITE, m_WinOption);
            }
            else
            {
                m_NBioAPI.Capture(out hCapturedFIR, NBioAPI.Type.TIMEOUT.DEFAULT, m_WinOption);
            }
            try
            {
                m_NBioAPI.GetFIRFromHandle(hCapturedFIR, out MyFir);
                m_NBioAPI.GetTextFIRFromHandle(hCapturedFIR, out textFIR, true);
                m_NBioAPI.CloseDevice(Dispositivo);
            }
            catch (Exception ex)
            {
                textFIR = null;
                MyFir   = null;
            }
        }