예제 #1
0
        private void IniciarComunicacaoScanner()
        {
            int resposta = ASO15_DEF.SFEP_Initialize();

            if (resposta != ASO15_DEF.RES_OK)
            {
                throw new Exception(resposta.ToString());
            }
        }
예제 #2
0
        private void ConfigurarHandlerImagem()
        {
            int resposta = ASO15_DEF.SFEP_SetConfig(_handle);

            if (resposta != ASO15_DEF.RES_OK)
            {
                throw new Exception(resposta.ToString());
            }
        }
예제 #3
0
        private void CriarTemplate()
        {
            int resposta = ASO15_DEF.SFEP_CreateTemplate(ref _template[quantidadeCaptura * ASO15_DEF.SFEP_UFPDATA_SIZE]);

            if (resposta != ASO15_DEF.RES_OK)
            {
                throw new Exception(resposta.ToString());
            }
        }
예제 #4
0
        private void InformarCaminhoDatabaseDigitais()
        {
            int resposta = ASO15_DEF.SFEP_SetDatabasePath(AppDomain.CurrentDomain.BaseDirectory);

            if (resposta != ASO15_DEF.RES_OK)
            {
                throw new Exception(resposta.ToString());
            }
        }
예제 #5
0
        private void EfetuarCapturaDigital()
        {
            Console.WriteLine("Coloque o dedo no leitor");
            int resposta = ASO15_DEF.SFEP_CaptureFingerImage(TIMEOUT_CAPTURA);

            if (resposta != ASO15_DEF.RES_OK)
            {
                throw new Exception(resposta.ToString());
            }
        }
예제 #6
0
        private byte[] ObterTemplateParaSalvar()
        {
            byte[] templateData = new byte[ASO15_DEF.SFEP_UFPDATA_SIZE];

            int resposta = ASO15_DEF.SFEP_GetTemplateForRegister(ref _template[0], ref templateData[0]);

            if (resposta != ASO15_DEF.RES_OK)
            {
                throw new Exception(resposta.ToString());
            }

            return(templateData);
        }
예제 #7
0
        private void RecuperarUltimaImagemCapturada()
        {
            string caminhoImagem = Path.GetTempFileName();

            int resposta = ASO15_DEF.SFEP_CurrentSaveBMP(caminhoImagem, ASO15_DEF.IMAGE_WIDTH, ASO15_DEF.IMAGE_HEIGHT);

            if (resposta != ASO15_DEF.RES_OK)
            {
                throw new Exception(resposta.ToString());
            }

            Console.WriteLine("Nova template obtida");
        }
예제 #8
0
        private void ConfigurarBrilhoHamster()
        {
            const byte BRILHO_PADRAO = 130;
            byte       brilhoHamster = 0;

            //Valor original 103

            if (ASO15_DEF.SFEP_GetBrightness(ref brilhoHamster) != ASO15_DEF.RES_OK)
            {
                throw new Exception("Falha ao obter valor do brilho");
            }

            if (brilhoHamster == BRILHO_PADRAO)
            {
                return;
            }

            if (ASO15_DEF.SFEP_SetBrightness(BRILHO_PADRAO) != ASO15_DEF.RES_OK)
            {
                throw new Exception("Falha configurar valor do brilho");
            }
        }
예제 #9
0
        public void Capturar()
        {
            try
            {
                InformarCaminhoDatabaseDigitais();

                IniciarComunicacaoScanner();

                ConfigurarHandlerImagem();

                ConfigurarBrilhoHamster();

                EfetuarCapturaDigital();

                CriarTemplate();

                RecuperarUltimaImagemCapturada();

                quantidadeCaptura += 1;

                while (quantidadeCaptura != QUANTIDADE_CAPTURA_DIGITAL && ASO15_DEF.SFEP_IsFingerPress())
                {
                    Thread.Sleep(100);
                }

                if (quantidadeCaptura == QUANTIDADE_CAPTURA_DIGITAL)
                {
                    ObterTemplateParaSalvar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                FinalizarComunicacaoScanner();
            }
        }
예제 #10
0
 private void FinalizarComunicacaoScanner()
 {
     ASO15_DEF.SFEP_Uninitialize();
 }