Griaule Biometrics

Home » Fingerprint SDK 2009 Developer's Manual » Programming Reference Guide » Fingerprint SDK DLL Reference Guide » Capture functions » GrCapRawImageToHandle

GrCapRawImageToHandle

Returns a displayable Windows bitmap handle (HBITMAP) to the supplied raw grayscale fingerprint image.

Prerequisites A valid license must exist on system.

Return On success, GR_OK is returned.
On failure, the appropriate error code is returned.

Parameters

[in] rawImage

A raw grayscale fingerprint image.

[in] width

Fingerprint image width in pixels.

[in] height

Fingerprint image height in pixels.

[in] hdc

The device context handle (HDC) in which the bitmap will be created.

[out] handle

The displayable fingerprint image Windows bitmap handle (HBITMAP).

See also

Declaration

C++

int __stdcall GrCapRawImageToHandle(unsigned char* rawImage, unsigned int width, unsigned int height, HDC hdc, HBITMAP &handle);

Delphi

function GrCapRawImageToHandle(rawImage: PChar; width, height: Integer; hdc: HDC; var handle: HBITMAP): Integer; stdcall;

Sample Code

C++

// handle to finger image
HBITMAP handle;
// screen HDC
HDC hdc = GetDC(0);

// get raw image
GrCapRawImageToHandle(_raw.img, _raw.width, _raw.height, hdc, handle);

// 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



// get screen HDC
hdc := GetDC(formMain.image.Canvas.Handle);

// get raw image
GrCapRawImageToHandle(raw.img, raw.width, raw.height, hdc, handle);

// 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);