Griaule Biometrics

Home » Fingerprint SDK 2009 Developer's Manual » Programming Reference Guide » Fingerprint SDK ActiveX Reference Guide » Capture methods » CapLoadImageFromFile

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

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;