Callback function responsible for handling the image event. This callback function is called whenever a fingerprint image is acquired from a plugged fingerprint reader.
| Prerequisites | The capture module must have been previously initialized. At least one fingerprint reader started capturing fingerprint images. |
| [in] idSensor |
The ID of the fingerprint reader that raised the event. |
| [in] width |
Fingerprint image width in pixels. |
| [in] height |
Fingerprint image height in pixels. |
| [in] rawImage |
The raw grayscale fingerprint image. |
| [in] res |
Fingerprint image resolution in DPI. |
C++
typedef void CALLBACK GRCAP_IMAGE_EVENT_PROC(char* idSensor, unsigned int width, unsigned int height, unsigned char* rawImage, int res);
Delphi
GRCAP_IMAGE_EVENT_PROC = Procedure(idSensor: PChar; width: Integer; height: Integer; rawImage: PChar; res: Integer); stdcall;
C++
void ImageEventHandler(char* idSensor, unsigned int width, unsigned int height, unsigned char* rawImage, int res) {
// Copying acquired image
memcpy(_raw.img, rawImage, width*height);
_raw.height = height;
_raw.width = width;
_raw.Res = res;
// Signaling that an Image Event occurred.
WriteEvent(idSensor, GR_IMAGE);
// display the fingerprint image
PrintBiometricDisplay(false, GR_DEFAULT_CONTEXT);
}
Delphi
Procedure ImageCallback(idSensor: PChar; imageWidth: Integer; imageHeight: Integer; rawImage: PChar; res: Integer); stdcall;
Begin
// Copying acquired image
raw.height := imageHeight;
raw.width := imageWidth;
raw.res := res;
Move(rawImage^, raw.img^, imageWidth*imageHeight);
// Signaling that an Image Event occurred.
WriteEvent(idSensor, GR_IMAGE);
// Display the fingerprint image
PrintBiometricDisplay(false, GR_DEFAULT_CONTEXT);
end;