• No results found

Biometric display methods BiometricDisplay

In document Fingerprint Sdk 2009 (Page 52-55)

SetBiometricDisplayColors

BiometricDisplay

Returns a picture display handle (IPictureDisp) 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.

Parameters

[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 picture will be created. [out] handle The fingerprint picture display handle (IPictureDisp).

[in] matchContext To 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).

See also

Fingerprint Image Format

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 Long VB .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 Long Delphi

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

SetBiometricDisplayColors

Sets the colors used to draw the minutiae, matching minutiae, segments, matching segments, minutiae directions and matching minutiae directions in the picture returned by the BiometricDisplay method. 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.

Parameters

[in] minutiaeColor Minutiae color in BGR 24-bits format. [in] minutiaeMatchedColor Matching minutiae color in BGR 24-bits format. [in] segmentsColor Segments color in BGR 24-bits format. [in] segmentsMatchedColor Matching segments color in BGR 24-bits format. [in] directionsColor Minutiae direction color in BGR 24-bits format. [in] directionsMatchedColor Matching minutiae direction color in BGR 24-bits format.

Remarks

Passing GR_IMAGE_NO_COLOR as any color causes the corresponding feature (minutia, matching minutia, segment, matching segment, minutia direction or matching minutia direction) not being drawn.

Passing all colors as GR_IMAGE_NO_COLOR causes the default colors to be used: red for minutiae, green for segments, blue for minutiae direction and magenta for matching minutiae, segments and minutiae

direction.

See also

Color Coding Format

Declaration

C++ .NET

int SetBiometricDisplayColors(int minutiaeColors, int minutiaeMatchedColors, int segmentColors, int segmentMatchedColors, int directionColors, int directionMatchedColors) C#

int SetBiometricDisplayColors(int minutiaeColors, int minutiaeMatchedColors, int segmentColors, int segmentMatchedColors, int directionColors, int directionMatchedColors) VB6

Function GrSetBiometricDisplayColors(ByVal minutiaeColors As Long, ByVal minutiaeMatchedColors As Long, ByVal segmentColors As Long, ByVal segmentMatchedColors As Long, ByVal directionColors As Long, ByVal directionMatchedColors As Long) As Long VB .NET

Function GrSetBiometricDisplayColors(ByVal minutiaeColors As Integer, ByVal minutiaeMatchedColors As Integer, ByVal segmentColors As Integer, ByVal segmentMatchedColors As Integer, ByVal directionColors As Integer, ByVal directionMatchedColors As Integer) As Integer Delphi

function GrSetBiometricDisplayColors (minutiaeColors, minutiaeMatchedColors, segmentColors, segmentMatchedColors, directionColors, directionMatchedColors: integer): integer;

Sample Code

C++ .NET

// set minutiae colors to red int minutiaeColor=Color::Red; int minutiaeMatchColor=Color::Red; // don't display any other biometric info int segmentsColor = GR_IMAGE_NO_COLOR; int segmentsMatchColor = GR_IMAGE_NO_COLOR; int directionsColor = GR_IMAGE_NO_COLOR; int directionsMatchColor = GR_IMAGE_NO_COLOR;

axGrFingerXCtrl2->SetBiometricDisplayColors(minutiaeColor, minutiaeMatchColor, segmentsColor, segmentsMatchColor, directionsColor, directionsMatchColor); C#

// set minutiae colors to red int minutiaeColor=Color.Red; int minutiaeMatchColor=Color.Red; // don't display any other biometric info

int segmentsColor = (int)GRConstants.GR_IMAGE_NO_COLOR; int segmentsMatchColor = (int)GRConstants.GR_IMAGE_NO_COLOR; int directionsColor = (int)GRConstants.GR_IMAGE_NO_COLOR; int directionsMatchColor = (int)GRConstants.GR_IMAGE_NO_COLOR;

axGrFingerXCtrl1.SetBiometricDisplayColors(minutiaeColor, minutiaeMatchColor, segmentsColor, segmentsMatchColor, directionsColor, directionsMatchColor); VB6

' set minutiae colors to red minutiaeColors = vbRed

' don't display any other biometric colors minutiaeMatchedColors = GR_IMAGE_NO_COLOR segmentColors = GR_IMAGE_NO_COLOR

segmentMatchedColors = GR_IMAGE_NO_COLOR directionColors = GR_IMAGE_NO_COLOR directionMatchedColors = GR_IMAGE_NO_COLOR

retVal= GrFingerXCtrl1.SetBiometricDisplayColors (minutiaeColors, minutiaeMatchedColors, segmentColors, segmentMatchedColors, directionColors, directionMatchedColors) VB .NET

' set minutiae colors to red minutiaeColors = Color.Red

' don't display any other biometric info minutiaeMatchedColors = GR_IMAGE_NO_COLOR segmentColors = GR_IMAGE_NO_COLOR segmentMatchedColors = GR_IMAGE_NO_COLOR directionColors = GR_IMAGE_NO_COLOR directionMatchedColors = GR_IMAGE_NO_COLOR

retVal= GrFingerXCtrl1.SetBiometricDisplayColors (minutiaeColors, minutiaeMatchedColors, segmentColors, segmentMatchedColors, directionColors, directionMatchedColors) Delphi var minutiaeColor: Integer; minutiaeMatchColor: Integer; segmentsColor: Integer; segmentsMatchColor: Integer; directionsColor: Integer; directionsMatchColor: Integer; begin

// set minutiae colors to red minutiaeColor := clRed; minutiaeMatchColor := clRed;

// don't display any other biometric info segmentsColor := GR_IMAGE_NO_COLOR; segmentsMatchColor := GR_IMAGE_NO_COLOR; directionsColor := GR_IMAGE_NO_COLOR; directionsMatchColor := GR_IMAGE_NO_COLOR;

GrFingerXCtrl1.SetBiometricDisplayColors(minutiaeColor, minutiaeMatchColor, segmentsColor, segmentsMatchColor, directionsColor, directionsMatchColor); end;

Other methods

GetGrFingerVersion DecodeBase64 EncodeBase64 InstallLicense IsBase64Encoding SetLicenseFolder

DecodeBase64

Decodes a Base64 template.

Prerequisites The template array must be already allocated. The recommended size is GR_MAX_SIZE_TEMPLATE bytes. Return On success, GR_OK is returned.On failure, the appropriate error code is returned.

Parameters

[in] encodedBuffer The template to be decoded.

[in] encodedSize The size in bytes of the supplied base64 template. [out] decodedBuffer The byte array in which the decoded template will be stored.

[in,out] decodedSize [in] The maximum size in bytes of the byte array supplied.

[out] The size in bytes of the decoded template.

See also

In document Fingerprint Sdk 2009 (Page 52-55)

Related documents