opel
unread,Dec 27, 2011, 4:18:33 PM12/27/11You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello All,
Am currently using a U.are U. 4500 biometric reader for a project but
have issues with the code written in VB6 sdk. I need someone that can
help converting the code to Powerbuilder, especially the template
declaration and the handle
' Raw image data type.
Public Type rawImage
' Image data.
img As Variant
' Image width.
width As Long
' Image height.
height As Long
' Image resolution.
res As Long
End Type
' Template data Type
Public Type TTemplate
' Template data
tpt() As Byte
' Template size
Size As Long
End Type
' An image was acquired from reader
Private Sub GrFingerXCtrl1_ImageAcquired(ByVal idSensor As String,
ByVal width As Long, ByVal height As Long, rawImage As Variant, ByVal
res As Long)
' Copying aquired image
With raw
.img = rawImage
.height = height
.width = width
.res = res
End With
' Signaling that an Image Event occurred.
writeLog ("Sensor: " & idSensor & ". Event: Image captured.")
' display fingerprint image
Call PrintBiometricDisplay(False, GR_DEFAULT_CONTEXT)
End Sub
' Display fingerprint image on screen
Public Sub PrintBiometricDisplay(ByVal biometricDisplay As Boolean,
ByVal context As Integer)
' handle to finger image
Dim handle As IPictureDisp
' return value
Dim ret As Integer
If biometricDisplay Then
' get image with biometric info
formMain.GrFingerXCtrl1.biometricDisplay template.tpt,
raw.img, raw.width, raw.height, raw.res, formMain.hDC, handle, context
Else
' get raw image
formMain.GrFingerXCtrl1.CapRawImageToHandle raw.img,
raw.width, raw.height, formMain.hDC, handle
End If
' draw image on picture box
If Not (handle Is Nothing) Then
formMain.img.Picture = handle
End If
End Sub
' Extract a fingerprint template from current image
Public Function ExtractTemplate() As Integer
Dim ret As Integer
' Set initial buffer size and allocate it
template.Size = GR_MAX_SIZE_TEMPLATE
' reallocate template buffer
ReDim Preserve template.tpt(template.Size)
ret = formMain.GrFingerXCtrl1.Extract(raw.img, raw.width,
raw.height, raw.res, template.tpt, template.Size, GR_DEFAULT_CONTEXT)
' if error, set template size to 0
' Result < 0 => extraction problem
If ret < 0 Then template.Size = 0
' Set real buffer size and free unecessary data
ReDim Preserve template.tpt(template.Size)
ExtractTemplate = ret
End Function