private static extern WinBioErrorCode Verify( WinBioSessionHandle sessionHandle, IntPtr identity, WinBioBiometricSubType subFactor, out int unitId, out bool match, out WinBioRejectDetail rejectDetail);
private extern static WinBioErrorCode CaptureSample( WinBioSessionHandle sessionHandle, WinBioBirPurpose purpose, WinBioBirDataFlags flags, out int unitId, out IntPtr sample, out int sampleSize, out WinBioRejectDetail rejectDetail);
public static int CaptureSample( WinBioSessionHandle sessionHandle, WinBioBirPurpose purpose, WinBioBirDataFlags flags, out int sampleSize, out WinBioRejectDetail rejectDetail) { int unitId; IntPtr pointer; var code = CaptureSample(sessionHandle, purpose, flags, out unitId, out pointer, out sampleSize, out rejectDetail); WinBioException.ThrowOnError(code, "WinBioCaptureSample failed"); //TODO: parse WINBIO_BIR structure at pointer Free(pointer); return(unitId); }
public static int CaptureSample( WinBioSessionHandle sessionHandle, WinBioBirPurpose purpose, WinBioBirDataFlags flags, out WinBioRejectDetail rejectDetail, out Bitmap fingerprintImage) { int unitId; int sampleSize; IntPtr samplePointer; var code = CaptureSample(sessionHandle, purpose, flags, out unitId, out samplePointer, out sampleSize, out rejectDetail); WinBioException.ThrowOnError(code, "WinBioCaptureSample failed"); WinBioBir sample = (WinBioBir)Marshal.PtrToStructure(samplePointer, typeof(WinBioBir)); if (sample.StandardDataBlock.Size == 0) { throw new WinBioException("Your fingerprint sensor doesn't support StandardDataBlock"); } IntPtr birHeaderPointer = samplePointer + sample.HeaderBlock.Offset; IntPtr ansiHeaderPointer = samplePointer + sample.StandardDataBlock.Offset; IntPtr ansiRecordPointer = ansiHeaderPointer + Marshal.SizeOf(typeof(WinBioBdbAnsi381Header)); WinBioBdbAnsi381Record ansiRecord = (WinBioBdbAnsi381Record)Marshal.PtrToStructure( ansiRecordPointer, typeof(WinBioBdbAnsi381Record)); Size imageSize = new Size(ansiRecord.HorizontalLineLength, ansiRecord.VerticalLineLength); IntPtr firstPixelPointer = ansiRecordPointer + Marshal.SizeOf(typeof(WinBioBdbAnsi381Record)); fingerprintImage = new Bitmap(imageSize.Width, imageSize.Height, 1 * imageSize.Width, PixelFormat.Format8bppIndexed, firstPixelPointer); ColorPalette palette = fingerprintImage.Palette; for (int i = 0; i <= 255; i++) { palette.Entries[i] = Color.FromArgb(i, i, i); } fingerprintImage.Palette = palette; Free(samplePointer); return(unitId); }
public static bool Verify( WinBioSessionHandle sessionHandle, WinBioIdentity identity, WinBioBiometricSubType subFactor, out int unitId, out WinBioRejectDetail rejectDetail) { bool match; var handle = GCHandle.Alloc(identity.GetBytes(), GCHandleType.Pinned); try { var code = Verify(sessionHandle, handle.AddrOfPinnedObject(), subFactor, out unitId, out match, out rejectDetail); WinBioException.ThrowOnError(code, "WinBioVerify failed"); } finally { handle.Free(); } return(match); }
public static int Identify( WinBioSessionHandle sessionHandle, out WinBioIdentity identity, out WinBioBiometricSubType subFactor, out WinBioRejectDetail rejectDetail) { int unitId; var bytes = new byte[WinBioIdentity.Size]; var handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); try { var code = Identify(sessionHandle, out unitId, handle.AddrOfPinnedObject(), out subFactor, out rejectDetail); WinBioException.ThrowOnError(code, "WinBioIdentify failed"); } finally { handle.Free(); } identity = new WinBioIdentity(bytes); return(unitId); }
public AuthenticationFailedEventArgs(WinBioError error, WinBioRejectDetail rejectDetail) { Error = error; RejectDetail = rejectDetail; }
public extern static WinBioErrorCode EnrollCapture(WinBioSessionHandle sessionHandle, out WinBioRejectDetail rejectDetail);
private extern static WinBioErrorCode Identify( WinBioSessionHandle sessionHandle, out int unitId, IntPtr identity, out WinBioBiometricSubType subFactor, out WinBioRejectDetail rejectDetail);
public AuthenticationFailedEventArgs(WinBioError error, WinBioRejectDetail rejectDetail) { Error = error; RejectDetail = rejectDetail; }