Returns a displayable Windows bitmap handle (HBITMAP) to the supplied raw grayscale fingerprint image with its minutiae, segments and minutiae direction drawn.
| Prerequisites | The Fingerprint SDK library must have been previously initialized. |
| Return | On success, GR_OK is returned. On failure, the appropriate error code is returned. |
| [in] tpt |
Template corresponding to the raw grayscale fingerprint image supplied. |
| [in] rawImage |
A raw grayscale fingerprint image. |
| [in] width |
Fingerprint image width in pixels. |
| [in] height |
Fingerprint image height in pixels. |
| [in] res |
Fingerprint image resolution in DPI. |
| [in] hdc |
The device context handle (HDC) in which the bitmap will be created. |
| [out] handle |
The displayable fingerprint image Windows bitmap handle (HBITMAP). |
| [in] matchContext |
To have only the minutiae, segments and minutiae direction of the supplied fingerprint drawn, this parameter must be GR_NO_CONTEXT. |
C++
int __stdcall GrBiometricDisplay(char* tptQuery, unsigned char* rawImage, int width, int height, int res, HDC hdc, HBITMAP &handle, int matchContext);
Delphi
function GrBiometricDisplay (templateReference: Pchar, rawImage: PChar; width, height: Integer; hdc: HDC; var handle: HBITMAP, context: Integer): Integer; stdcall;
C++
// 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;
};
// handle to finger image
HBITMAP handle;
// screen HDC
HDC hdc = GetDC(0);
// get image with biometric info
GrBiometricDisplay((char *)_tpt->_tpt, _raw.img, _raw.width, _raw.height, _raw.Res, hdc, handle, context);
// draw image on picture box
if (handle != NULL) {
Image *curImage = System::Drawing::Image::FromHbitmap(handle);
_pbPic->Image = curImage;
}
// release HDC
ReleaseDC(HWND(NULL), 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;begin
// get screen HDC
hdc := GetDC(formMain.image.Canvas.Handle);// get image with biometric info
GrBiometricDisplay(template.tpt,raw.img, raw.width, raw.height,raw.Res, hdc,handle, context)// draw image on picture box
if handle <> 0 then
begin
formMain.image.Picture.Bitmap.Handle := handle;
formMain.image.Repaint();
end;// release screen HDC
ReleaseDC(formMain.image.Canvas.Handle, hdc);
End