private void Extract([In] IntPtr rawimage, int width, int height, int res, ref FingerprintTemplate fingerTemplate, int context) { IntPtr zero = IntPtr.Zero; try { int cb = 0x2710 * Marshal.SizeOf(typeof(byte)); zero = Marshal.AllocHGlobal(cb); int quality = FingerprintException.CheckError(GrFingerprintProxy.GrExtract(rawimage, width, height, res, zero, ref cb, context)); zero = Marshal.ReAllocHGlobal(zero, (IntPtr)cb); fingerTemplate = new FingerprintTemplate(zero, cb, quality); } catch (OutOfMemoryException exception) { throw new FingerprintException(-7, exception); } catch (AccessViolationException exception2) { throw new FingerprintException(-113, exception2); } finally { Marshal.FreeHGlobal(zero); } }
private void GetBiometricDisplay(FingerprintTemplate tptQuery, IntPtr rawImage, int width, int height, int res, IntPtr hdc, ref IntPtr handle, int matchContext) { IntPtr zero = IntPtr.Zero; try { zero = Marshal.AllocHGlobal(tptQuery.Size); Marshal.Copy(tptQuery.Buffer, 0, zero, tptQuery.Size); int errorCode = 0; try { errorCode = GrFingerprintProxy.GrBiometricDisplay(zero, rawImage, width, height, res, hdc, ref handle, matchContext); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); } catch (OutOfMemoryException exception3) { throw new FingerprintException(-7, exception3); } finally { Marshal.FreeHGlobal(zero); } }
public void StopCapture(object idSensor) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapStopCapture(idSensor.ToString()); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } finally { if (this.gchFinger.IsAllocated) { this.gchFinger.Free(); } if (this.gchImage.IsAllocated) { this.gchImage.Free(); } } FingerprintException.CheckError(errorCode); }
public void CaptureFinalize() { try { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapFinalize(); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); } finally { if (this.grStatusEventHandler != null) { this.grStatusEventHandler = null; if (this.gchStatus.IsAllocated) { this.gchStatus.Free(); } } } }
private void GetHandlerFromRawImage(IntPtr rawImage, int width, int height, IntPtr hdc, ref IntPtr image) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapRawImageToHandle(rawImage, width, height, hdc, ref image); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
public void DestroyContext(int context) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrDestroyContext(context); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
private void CaptureInitialize(GrStatusEventHandler grStatusEventHandler) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapInitialize(grStatusEventHandler); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
private void IdentifyPrepare(IntPtr queryTemplate, int context) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrIdentifyPrepare(queryTemplate, context); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
public void StartEnroll(int context) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrStartEnroll(context).ToInt32(); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
private void StartCapture(string sensor, GrFingerEventHandler grFingerEventHandler, GrImageEventHandler grImageEventHandler) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapStartCapture(sensor, grFingerEventHandler, grImageEventHandler); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
private void ConvertTemplate([In] IntPtr tpt, [Out] IntPtr newTpt, ref int newTptSize, int context, int format) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrConvertTemplate(tpt, newTpt, ref newTptSize, context, format); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
public void SetBiometricDisplayColors(int minutiaeColor, int minutiaeMatchedColor, int segmentColor, int segmentMatchedColor, int inclinationColor, int inclinationMatchedColor) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrSetBiometricDisplayColors(minutiaeColor, minutiaeMatchedColor, segmentColor, segmentMatchedColor, inclinationColor, inclinationMatchedColor); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
public void SetVerifyParameters(int verifyThreshold, int verifyRotationTolerance, int context) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrSetVerifyParameters(verifyThreshold, verifyRotationTolerance, context); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
private void SaveRawImageToFile(IntPtr rawimage, int width, int height, string fileName, GrCaptureImageFormat imageFormat) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapSaveRawImageToFile(rawimage, width, height, fileName, imageFormat); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-7, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
public void LoadImageFromFile(string filename, int res) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrCapLoadImageFromFile(filename, res); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
public static void InstallLicense(string productKey) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrInstallLicense(productKey); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); }
public static int DecodeBase64(IntPtr encodedBuffer, int encodedSize, ref IntPtr decodedBuffer, ref int decodedSize) { int errorCode = 0; try { errorCode = GrFingerprintProxy.DecodeBase64(encodedBuffer, encodedSize, decodedBuffer, ref decodedSize); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); return(errorCode); }
private int Enroll([In] IntPtr rawimage, int width, int height, int res, IntPtr tpt, ref int tptSize, ref int quality, int tptFormat, int context) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrEnroll(rawimage, width, height, res, tpt, ref tptSize, ref quality, tptFormat, context); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); return(errorCode); }
private int Verify(IntPtr queryTemplate, IntPtr referenceTemplate, out int verifyScore, int context) { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrVerify(queryTemplate, referenceTemplate, out verifyScore, context); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); return(errorCode); }
public void Initialize() { int errorCode = 0; try { errorCode = GrFingerprintProxy.GrInitialize(); } catch (AccessViolationException exception) { FingerprintException exception2 = new FingerprintException(-113, exception); throw exception2; } FingerprintException.CheckError(errorCode); this.bInitialized = true; }