• No results found

See also Events

In document Fingerprint Sdk 2009 (Page 47-52)

Declaration

C++ .NET int CapInitialize() C#

int CapInitialize() VB6

Function CapInitialize() As Long VB .NET

Function CapInitialize() As Integer Delphi

Function CapInitialize(): integer;

Sample Code

C++ .NET

retVal= _grfingerx->CapInitialize();

C#

retVal= _grfingerx.CapInitialize();

VB6

retVal= GrFingerXCtrl1.CapInitialize VB .NET

retVal= GrFingerXCtrl1.CapInitialize Delphi

retVal:= GrFingerXCtrl1.CapInitialize();

CapFinalize

Stops the capture module, freeing any resource used.

Prerequisites The capture module must have been previously initialized.

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

Declaration

C++ .NET int CapFinalize() C#

int CapFinalize () VB6

Function CapFinalize () As Long VB .NET

Function CapFinalize () As Integer Delphi

Function CapFinalize (): integer;

Sample Code

C++ .NET

retVal= _grfingerx->CapFinalize();

C#

retVal= _grfingerx.CapFinalize();

VB6

retVal= GrFingerXCtrl1.CapFinalize VB .NET

retVal= GrFingerXCtrl1.CapFinalize Delphi

retVal:= GrFingerXCtrl1.CapFinalize();

CapStartCapture

Starts capturing fingerprint images from the supplied fingerprint reader.

Prerequisites The capture module must have been previously initialized.The supplied fingerprint reader must be connected, working and recognized as plugged by the capture module.

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

Parameters

[in] idSensor The ID of the fingerprint reader to start capturing images from.

See also

Events

Declaration

C++ .NET

int CapStartCapture (string idSensor) C#

int CapStartCapture (string idSensor)

VB6

Function CapStartCapture (ByVal idSensor As String) VB .NET

Function CapStartCapture (ByVal idSensor As String) Delphi

function CapStartCapture(const idSensor: WideString): integer;

Sample Code

C++ .NET

axGrFingerXCtrl2->CapStartCapture(e->idSensor);

C#

axGrFingerXCtrl1.CapStartCapture(e.idSensor);

VB6

GrFingerXCtrl1.CapStartCapture (idSensor) VB .NET

AxGrFingerXCtrl1.CapStartCapture(e.idSensor) Delphi

GrFingerXCtrl1.CapStartCapture (idSensor);

CapStopCapture

Stops capturing fingerprint images from the supplied fingerprint reader.

Prerequisites The capture module must have been previously initialized.Image capture must have been previously started on the supplied fingerprint reader.

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

Parameters

[in] idSensor The ID of the fingerprint reader to stop capturing images from.

Declaration

C++ .NET

int CapStopCapture (string idSensor) C#

int CapStopCapture (string idSensor) VB6

Function CapStopCapture (ByVal idSensor As String) As Long VB .NET

Function CapStopCapture (ByVal idSensor As String) As Integer Delphi

function CapStopCapture(const idSensor: WideString): integer;

Sample Code

C++ .NET

axGrFingerXCtrl2->CapStopCapture(e->idSensor);

C#

axGrFingerXCtrl1.CapStopCapture(e.idSensor);

VB6

GrFingerXCtrl1.CapStopCapture (idSensor)

VB .NET

AxGrFingerXCtrl1.CapStopCapture(e.idSensor) Delphi

GrFingerXCtrl1.CapStopCapture (idSensor);

CapSaveRawImageToFile

Saves a raw grayscale fingerprint image as a picture file.

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] filename The complete path and filename of the picture file to create.

[in] imageFormat Picture file format.

See also

Fingerprint Image Format

Declaration

C++ .NET

int CapSaveRawImageToFile (ref object RawImage, int width, int height, string filename, int imageFormat) C#

int CapSaveRawImageToFile (ref Object RawImage, int width, int height, string filename, int imageFormat) VB6

Function CapSaveRawImageToFile (ByRef RawImage As Variant, ByVal width As Long, ByVal height As Long, ByVal filename As String, ByVal imageFormat As Long) As Long VB .NET

Function CapSaveRawImageToFile (ByRef RawImage As Object, ByVal width As Integer, ByVal height As Integer, ByVal filename As String, ByVal imageFormat As Integer) As Integer Delphi

function CapSaveRawImageToFile(vat rawImage: OleVariant; width, height: integer; filename: WideString; imageFormat: GRCAP_IMAGE_FORMAT): integer;;

Sample Code

C++ .NET

if (axGrFingerXCtrl2->CapSaveRawImageToFile(&_raw->img, _raw->width, _raw->height, FileName, GRCAP_IMAGE_FORMAT_BMP) != GR_OK) { WriteLog("Failed to save the file.");

}

C#

if (axGrFingerXCtrl1.CapSaveRawImageToFile(ref _raw.img, _raw.width, _raw.height, FileName, (int)GRConstants.GRCAP_IMAGE_FORMAT_BMP) != (int)GRConstants.GR_OK) { WriteLog("Failed to save the file.");

}

VB6

If GrFingerXCtrl1.CapSaveRawImageToFile(raw.img, raw.width, raw.height, FileName, GRCAP_IMAGE_FORMAT_BMP) <> GR_OK Then writeLog ("Failed to save the file.")

End If

VB .NET

If AxGrFingerXCtrl1.CapSaveRawImageToFile(raw.img, raw.width, raw.height, FileName, GRConstants.GRCAP_IMAGE_FORMAT_BMP) <> GRConstants.GR_OK Then WriteLog("Fail to save the file.")

End If

Delphi

if GrFingerXCtrl1.CapSaveRawImageToFile(raw.img, raw.width, raw.Height, fname, GRCAP_IMAGE_FORMAT_BMP) <> GR_OK then WriteLog('Fail to save the file.');

CapLoadImageFromFile

Loads a grayscale fingerprint image from a picture file.

Prerequisites The capture module must have been previously initialized.

Picture file must be in one of the supported formats, as defined in the section.

Image capture must have been previously started on the "File" sensor.

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

Parameters

[in] fileName The complete path and filename of the picture file to load.

[in] res Image resolution in DPI.

Remarks

On success, an image event is fired for the "File" sensor.

See also

Events

Declaration

C++ .NET

int CapLoadImageFromFile (string filename, int res) C#

int CapLoadImageFromFile (string filename, int res) VB6

Function CapLoadImageFromFile (ByVal filename As String, ByVal res As Long) As Long VB .NET

Function CapLoadImageFromFile (ByVal filename As String, ByVal res As Integer) As Integer Delphi

function CapLoadImageFromFile(const filename: WideString; res: integer): integer;

Sample Code

C++ .NET

// Getting the resolution.

int resolution = Convert::ToInt32(InputBox::ShowModal("What is the image resolution?", "Resolution", ""));

// Checking if the action was canceled, no value or an invalid value //was entered.

if (resolution != 0) {

axGrFingerXCtrl2->CapLoadImageFromFile(ofdImage->FileName, resolution);

}

C#

// Getting the resolution.

String res = InputBox.Show("What is the image resolution?", "Resolution", "").Text;

if (!res.Equals("")) {

int resolution = Convert.ToInt32(res);

// Checking if the action was canceled, no value or an invalid value //was entered.

if (resolution != 0) {

axGrFingerXCtrl1.CapLoadImageFromFile(ofdImage.FileName, resolution);

} }

VB6

' Getting the resolution.

res = Val(InputBox("Enter the resolution of the selected image", "Resolution")) ' Checking if the action was canceled, no value or an invalid value was entered.

If res <> 0 Then

GrFingerXCtrl1.CapLoadImageFromFile CommonDialog.FileName, res End If

VB .NET

' Getting the resolution.

resolution = Val(InputBox("What is the image resolution?", "Resolution", "")) ' Checking if the action was canceled, no value or an invalid value was entered.

If (resolution <> 0) Then

AxGrFingerXCtrl1.CapLoadImageFromFile(OpenFileDialog1.FileName, resolution) End If

Delphi

// Getting image resolution.

resolution := StrToInt(InputBox('What is the image resolution?', 'Resolution', ''));

// Checking if the action was canceled, no value or an invalid value was entered.

if (resolution <> 0) then begin

GrFingerXCtrl1.CapLoadImageFromFile(OpenPictureDialog.FileName, resolution);

end;

CapRawImageToHandle

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

[out] handle The fingerprint picture display handle (IPictureDisp).

See also

Fingerprint Image Format

Declaration

C++ .NET

int CapRawImageToHandle (ref object RawImage, int width, int height, int hdc, ref stdole.IPictureDisp handler) C#

int CapRawImageToHandle (ref Object RawImage, int width, int height, int hdc, ref stdole.IPictureDisp handler) VB6

Function CapRawImageToHandle (ByRef RawImage As Variant, ByVal width As Long, ByVal height As Long, ByVal hdc As Long, ByRef handler As IPictureDisp) As Long VB .NET

Function CapRawImageToHandle (ByRef RawImage As Object, ByVal width As Integer, ByVal height As Integer, ByVal hdc As Integer, ByRef handler As stdole.IPictureDisp) As Integer Delphi

function CapRawImageToHandle(var rawImage: OleVariant; width, height: integer; hdc: HDC; var handler: IPictureDisp): integer;

Sample Code

C++ .NET

stdole::IPictureDisp *handle;

// screen HDC

Graphics *g = _btEnroll->CreateGraphics();

IntPtr hdc = g->GetHdc();

_grfingerx->CapRawImageToHandle(&_raw->img, _raw->width, _raw->height, hdc.ToInt32(), &handle);

if (handle != NULL) {

Image *curImage = System::Drawing::Image::FromHbitmap(handle->Handle);

_pbPic->Image = curImage;

_pbPic->Update();

}g->ReleaseHdc(hdc);

C#

IPictureDisp handle = null;

// screen HDC

IntPtr hdc = GetDC(System.IntPtr.Zero);

_grfingerx.CapRawImageToHandle(ref _raw.img,_raw.width,_raw.height, hdc.ToInt32(), ref handle);

// draw image on picture box if (handle != null)

{ _pbPic.Image = GrFingerXSampleCS.

ImageConverter.IpictureToImage(handle);

_pbPic.Update();

}

ReleaseDC(System.IntPtr.Zero,hdc);

VB6

Dim handle As IPictureDisp

GrFingerXCtrl1.CapRawImageToHandle raw.img, raw.width, raw.height, formMain.hDC, handle If Not (handle Is Nothing) Then

img.Picture = handle End If

VB .NET

' handle to finger image

Dim handle As stdole.IPictureDisp = Nothing ' screen HDC

Dim hdc = GetDC(0)

_GrFingerX.CapRawImageToHandle(raw.img, raw.width, raw.height, hdc, handle) 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

var // handle to finger image handle: IPictureDisp;

// screen HDC hdc: LongInt;

begin

GrFingerXCtrl1.CapRawImageToHandle(raw.img, raw.width, raw.height, hdc, handle);

if handle <> nil then begin

SetOlePicture(image.Picture, handle);

image.Repaint();

end;

// release screen HDC ReleaseDC(HWND(nil), hdc);

In document Fingerprint Sdk 2009 (Page 47-52)

Related documents