Visual Basic.NET - huella digital parte 3

 
Vista:

huella digital parte 3

Publicado por Miguel Figueroa (7 intervenciones) el 02/10/2008 10:27:04
'Verificamos si la Data Obtenida de la Imagen es Válida
Private Function TemplateIsValid() As Boolean
' Verifica el tamaño del Lector
Return template.Size > 0
End Function

' Método que Inicializa el Uso Lector Public Function InitializeGrFinger() As Integer
Dim err As Integer
DB = New DBClass
' Abre la Base de Datos
If DB.OpenDB() = False Then Return ERR_CANT_OPEN_BD
' creamos un nuevo template
template.Size = 0
' Creamos La Imagen
raw.img = Nothing
raw.width = 0
raw.height = 0
' Guardamos el Resultado de la Inicializacion del Lector
err = _GrFingerX.Initialize()
' Si es menor que 0 es porque ocurrio un error con el lector
sea de lectura y/o de conexion
If err < 0 Then Return err
Return _GrFingerX.CapInitialize()
End Function

' Método que Finaliza la Captura y el Uso del Lector de
Huellas
Public Sub FinalizeGrFinger()
_GrFingerX.Finalize()
_GrFingerX.CapFinalize()
End Sub

' Obtiene la Imagen del Lector y la Muestra en el PictureBox
Public Sub PrintBiometricDisplay(ByVal biometricDisplay As Boolean, ByVal context As Integer)
' Maneja la Imagen de Un Dedo
Dim handle As System.Drawing.Image = Nothing
' HDC de la Pantalla
Dim hdc As Integer = GetDC(0)

If biometricDisplay Then
' Obtiene la Imagen con la Informacion Biométrica
_GrFingerX.BiometricDisplay(template.tpt, raw.img, raw.width, _
raw.height, raw.res, hdc, _
handle, context)
Else
_GrFingerX.CapRawImageToHandle(raw.img, raw.width, raw.height, hdc, handle)
End If

' Dibuja la Imagen Obtenida en el PictureBox
If Not (handle Is Nothing) Then
_pbPic.Image = handle
_pbPic.Update()
End If
' Quitamos de Memoria El HDC de la Pantalla Obtenido
ReleaseDC(0, hdc)
End Sub

' Guarda la Data de la Huella Digital Obtenida en la Base
de Datos
Public Function Enroll(ByVal contded As Integer, ByVal Cedula As String) As Integer
' Verifica si la Data de la Huella Obtenida es Valida
If TemplateIsValid() Then

' Guarda la Huella digital Obtenida, con la Cedula de la
Persona y Genera un ID para la Huella
Return DB.AddTemplate(template, Cedula, contded)
Else
Return -1
End If
End Function

Function ExtractTemplate() As Integer
Dim ret As Integer
template.Size = template.tpt.Length
ret = _GrFingerX.Extract(raw.img, raw.width, raw.height, raw.res, template.tpt, _
template.Size, GRConstants.GR_DEFAULT_CONTEXT)
If ret < 0 Then template.Size = 0
Return ret
End Function

Public Function Identify(ByRef score As Integer) As Integer
Dim ret As Integer
Dim i As Integer
If Not TemplateIsValid() Then Return ERR_INVALID_TEMPLATE
ret = _GrFingerX.IdentifyPrepare(template.tpt, GRConstants.GR_DEFAULT_CONTEXT)
If ret < 0 Then Return ret
Dim templates As TTemplates() = DB.getTemplates()
For i = 1 To templates.Length - 1
If Not (templates(i).template Is Nothing) Then
ret = _GrFingerX.Identify(templates(i).template.tpt, score, _
GRConstants.GR_DEFAULT_CONTEXT)
End If
If ret = GRConstants.GR_MATCH Then
Return templates(i).ID
End If
If ret < 0 Then Return ret
Next
Return GRConstants.GR_NOT_MATCH
End Function

Public Function Verify(ByVal id As Integer, ByRef score As Integer) As Integer
Dim tptref As Byte()
If Not (TemplateIsValid()) Then Return ERR_INVALID_TEMPLATE
tptref = DB.getTemplate(id)
If tptref Is Nothing Then Return ERR_INVALID_ID
Return _GrFingerX.Verify(template.tpt, tptref, score, GRConstants.GR_DEFAULT_CONTEXT)
End Function

Public Function ObtenerNombre(ByVal Cedula As String) As String
Dim NomComp As String
Dim cn As New System.Data.SqlClient.SqlConnection(My.Settings.AccesoConnectionString)
Dim cmd As New System.Data.SqlClient.SqlCommand( _
"Select Nombre, Apellido From Empleados Where Cedula='" _
& Cedula & "'", cn)
cn.Open()
Dim rd As System.Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
If rd.Read Then
NomComp = Trim(rd.Item("Nombre").ToString) & " " & Trim(rd.Item("Apellido").ToString)
Return NomComp
Else
Return ""
End If
cn.Close()
End Function


End Class
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:huella digital parte 3

Publicado por Carlos Oviedo (2 intervenciones) el 15/05/2009 22:13:17
Me puedes mandar el programa completo al casillero: [email protected]
Soy estudiante de Informática y quiero implementar algo asi para un programa y quiero estudiarlo más.

Te agradesco mucho
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:huella digital parte 3

Publicado por Andrey Garcia  (3 intervenciones) el 08/10/2009 22:07:07
Estoy queriendo implementar algo asi no se si me puedes mandar el programa o el codigo fuente para ver como esque se hace todo esto.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

huella digital parte 3

Publicado por MANUEL (1 intervención) el 27/08/2011 05:16:25
CUAL ES CODIGO DE VISUAL BASIC 2008 PARA LEER LA HUELLA DIGITAL PLEASE AYUDA COMO LE HAGO
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

huella digital parte 3

Publicado por Jorge (5 intervenciones) el 05/11/2015 10:00:26
¿podrías mandarme el programa con el código fuente por favor? gracias, saludos [email protected]
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar