[Migrated content. Thread originally posted on 02 March 2010]
Hi all, I am trying to get a biometric solution up and running with Acucobol!I am using the Griaule Fingerprint SDK 2009 active x control with a Futronic FS80 model.
I am afraid I have spun myself into a web of confusion, I can Initialize, Create Context, Capture Initialize, Start Capture and record all events but I can not get much further than that?
Has anyone got any suggestions or should I just pass the buck to the Java Programmer?
Griaule SDK Documentation Link
http://www.griaulebiometrics.com/page/en-us/manual/fingerprint-sdk/programming-reference-guide/activex
I have attached the generated def file...
I am not sure how to define the following...
* BiometricDisplay
* method BiometricDisplay
METHOD, 22, @BiometricDisplay,
"SAFEARRAY(unsigned char)*" @tptQuery, TYPE 16401,
"VARIANT*" @rawImage, TYPE 16396,
"long" @width, TYPE 3,
"long" @height, TYPE 3,
"long" @res, TYPE 3,
"long" @hdc, TYPE 3,
"IPictureDisp**" @handler, TYPE 16413,
"long" @matchContext, TYPE 3
RETURNING "long", TYPE 3
The documentation from Griaule is as follows:
Returns a picture display handle (IPictureDisp) to the supplied raw grayscale fingerprint image with its minutiae, segments and minutiae direction drawn.
PrerequisitesThe Fingerprint SDK library must have been previously initialized.
ReturnOn success, GR_OK is returned.
On failure, the appropriate error code is returned.
Parameters
[in] tptTemplate corresponding to the raw grayscale fingerprint image supplied.
[in] rawImageA raw grayscale fingerprint image.
[in] widthFingerprint image width in pixels.
[in] heightFingerprint image height in pixels.
[in] resFingerprint image resolution in DPI.
[in] hdcThe device context handle (HDC) in which the picture will be created.
[out] handleThe fingerprint picture display handle (IPictureDisp).
[in] matchContextTo have only the minutiae, segments and minutiae direction of the supplied fingerprint drawn, this parameter must be GR_NO_CONTEXT.
To have also the macthing minutiae, segments and minutiae direction drawn, this parameter must be the context identifier corresponding to the matching (identification or verification).
Declaration
C .NET
int BiometricDisplay (ref byte[] tptQuery,ref object rawImage, int width, int height, int hdc, ref stdole.IPictureDisp handle, int matchContext)C#
int BiometricDisplay (ref Array tptQuery,ref Object rawImage, int width, int height, int hdc, ref stdole.IPictureDisp handle, int matchContext)VB6
Function BiometricDisplay (ByRef tptQuery() As Byte, ByRef rawImage As Variant, ByVal width As Long, ByVal height As Long, ByVal hdc As Long, ByRef handle As IPictureDisp, ByVal matchContext As Long) As LongVB .NET
Function BiometricDisplay (ByRef tptQuery As Array, ByRef rawImage As Object, ByVal width As Integer, ByVal height As Integer, ByVal hdc As Integer, ByRef handle As stdole.IPictureDisp, ByVal matchContext As Integer) As LongDelphi
function BiometricDisplay(var tptQuery: PSafeArray; var rawImage: OleVariant; width: Integer; height: Integer; res: Integer; hdc: integer; var handler: IPictureDisp; matchContext: Integer): Integer;Sample Code
C .NET
// the template class__gc class TTemplate {public: // Template data. System::Byte _tpt[]; // Template size int _size;
TTemplate(void);
~TTemplate(void);
};
// Raw image data type.
__gc struct TRawImage {
// Image data.
System::Object *img;
// Image width.
unsigned int width;
// Image height.
unsigned int height;
// Image resolution.
int Res;
};
stdole::IPictureDisp *handle;
// screen HDC
Graphics *g = _btEnroll->CreateGraphics();
IntPtr hdc = g->GetHdc();
_grfingerx->BiometricDisplay(&_tpt->_tpt, &_raw->img, _raw->width, _raw->height, _raw->Res, hdc.ToInt32(), &handle, context);
if (handle != NULL) {
Image *curImage = System::Drawing::Image::FromHbitmap(handle->Handle);
_pbPic->Image = curImage;
_pbPic->Update();
}
g->ReleaseHdc(hdc);
C#
public class TTemplate
{
// Template data.
public Array _tpt;
// Template size
public int _size; public TTemplate(){
// Create a byte buffer for the template
_tpt = new byte[(int)GRConstants.GR_MAX_SIZE_TEMPLATE];
_size = 0;
}
}
// Raw image data type.
public struct TRawImage
{
// Image data.
public object img;
// Image width.
public int width;
// Image height.
public int height;
// Image resolution.
public int Res;
};
IPictureDisp handle = null;
// screen HDC
IntPtr hdc = GetDC(System.IntPtr.Zero);
_grfingerx.BiometricDisplay(ref _tpt._tpt, ref raw.img, _raw.width, _raw.height, _raw.Res,hdc.ToInt32(), ref handle,(int)contextId);
// draw image on picture box
if (handle != null)
{
_pbPic.Image = GrFingerXSampleCS.
ImageConverter.IpictureToImage(handle);
_pbPic.Update();
}
ReleaseDC(System.IntPtr.Zero,hdc);
VB6
' 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
Dim handle As IPictureDisp
GrFingerXCtrl1.biometricDisplay template.tpt, raw.img, raw.width, raw.height, raw.res, formMain.hDC, handle, context
If Not (handle Is Nothing) Then
img.Picture = handle
End If
VB .NET
' Template data
Public Class TTemplate
' Template itself
Public tpt(GrFingerXLib.GRConstants.GR_MAX_SIZE_TEMPLATE) As Byte
' Template size
Public Size As Long
End Class' Raw image data type.
Public Structure RawImage
' Image data.
Public img As Object
' Image width.
Public width As Long
' Image height.
Public height As Long
' Image resolution.
Public res As Long
End Structure
' handle to finger image
Dim handle As stdole.IPictureDisp = Nothing
' screen HDC
Dim hdc = GetDC(0)
_GrFingerX.BiometricDisplay(template.tpt, raw.img, raw.width, raw.height, raw.res, hdc, handle, context)
If Not (handle Is Nothing) Then
_pbPic.Image = Image.FromHbitmap(New IntPtr(handle.Handle), New IntPtr(handle.hPal))
_pbPic.Update()
End If
' release screen HDC
ReleaseDC(0, hdc)
Delphi
type
// Raw image data type.
TRawImage = record
// Image data.
img: OleVariant;
// Image width.
width: Integer;
// Image height.
Height: Integer;
// Image resolution.
Res: Integer;
end;// Define a type to temporary storage of template
TTemplate = class
public
// Template data.
tpt: PSafeArray;
// Template size
size: Integer;
// Template ID (if retrieved from DB)
id: Integer;
var
// handle to finger image
handle: IPictureDisp;
// screen HDC
hdc: LongInt;
begin
GrFingerXCtrl1.BiometricDisplay(template.tpt,raw.img, raw.width, raw.height,raw.Res, hdc, handle, context)
if handle <> nil then
begin
SetOlePicture(image.Picture, handle);
image.Repaint();
end;
// release screen HDC
ReleaseDC(HWND(nil), hdc);
Any help or guidance will be appreciated?



