Click here to Skip to main content
15,665,319 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to Biometric Application. 
I am trying to write a biometric fingerprint capture form but I am stocked up and I don't have idea on how to go further from here.
The following are my code I am trying out but I discovered that the Oncomplete event is not firing. please can anyone help me out on what is wrong with the code?


What I have tried:

Imports DPFP
Imports DPFP.Capture
Imports DPFP.Capture.ReadersCollection

Public Class frmBioCaptures
    Implements EventHandler

    Private mReader As Capture
    Private mReaders As ReadersCollection

    Public Sub New()

        ' This call is required by the designer.

        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Private Sub LoadReaders()
        mReaders = New ReadersCollection()

        Dim deviceFound As Boolean = mReaders.Count > 0

        If deviceFound Then
            For Each rDevice In mReaders.Values
        End If
    End Sub

    Private Sub frmBioCaptures_Load(sender As Object, e As EventArgs) Handles Me.Load
    End Sub

    Private Sub cmbReaders_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbReaders.SelectedIndexChanged
        bntStartEnroll.Enabled = cmbReaders.SelectedIndex > -1
    End Sub

    Private Sub bntStartEnroll_Click(sender As Object, e As EventArgs) Handles bntStartEnroll.Click
        Dim devID As String = mReaders(cmbReaders.SelectedIndex).SerialNumber
        mReader = New Capture(devID, Priority.Normal)
        mReader.EventHandler = Me
    End Sub

    Public Sub OnComplete(Capture As Object, ReaderSerialNumber As String, Sample As Sample) Implements EventHandler.OnComplete
    End Sub

    Public Sub OnFingerGone(Capture As Object, ReaderSerialNumber As String) Implements EventHandler.OnFingerGone

    End Sub

    Public Sub OnFingerTouch(Capture As Object, ReaderSerialNumber As String) Implements EventHandler.OnFingerTouch

    End Sub

    Public Sub OnReaderConnect(Capture As Object, ReaderSerialNumber As String) Implements EventHandler.OnReaderConnect

    End Sub

    Public Sub OnReaderDisconnect(Capture As Object, ReaderSerialNumber As String) Implements EventHandler.OnReaderDisconnect

    End Sub

    Public Sub OnSampleQuality(Capture As Object, ReaderSerialNumber As String, CaptureFeedback As CaptureFeedback) Implements EventHandler.OnSampleQuality

    End Sub

    Protected Function ConvertSampleToBitmap(ByVal Sample As DPFP.Sample) As Bitmap
        Dim convertor As New DPFP.Capture.SampleConversion()  ' Create a sample convertor.
        Dim bitmap As Bitmap = Nothing              ' TODO: the size doesn't matter
        convertor.ConvertToPicture(Sample, bitmap)        ' TODO: return bitmap as a result
        Return bitmap
    End Function

    Protected Function ExtractFeatures(ByVal Sample As DPFP.Sample, ByVal Purpose As DPFP.Processing.DataPurpose) As DPFP.FeatureSet
        Dim extractor As New DPFP.Processing.FeatureExtraction()    ' Create a feature extractor
        Dim feedback As DPFP.Capture.CaptureFeedback = DPFP.Capture.CaptureFeedback.None
        Dim features As New DPFP.FeatureSet()
        extractor.CreateFeatureSet(Sample, Purpose, feedback, features) ' TODO: return features as a result?
        If (feedback = DPFP.Capture.CaptureFeedback.Good) Then
            Return features
            Return Nothing
        End If
    End Function

    Private Sub Process(ByVal sample As Sample)
    End Sub

    Private Sub DrawPicture(ByVal bmp)
        imgFinger.Image = New Bitmap(bmp, imgFinger.Size)
    End Sub

End Class
[no name] 6-Jul-18 11:31am    
I have no idea what implementing in the place of Handles is able to do.

Use Private Sub whatever(something) Handles thing.OnComplete

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900