コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 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();
             }
         }
     }
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public static void SetLicenseFolder(string licenseFolder)
 {
     try
     {
         GrFingerprintProxy.GrSetLicenseFolder(licenseFolder);
     }
     catch (AccessViolationException exception)
     {
         FingerprintException exception2 = new FingerprintException(-113, exception);
         throw exception2;
     }
 }
コード例 #6
0
        public static int EncodeBase64(IntPtr buffer, int bufferSize, ref IntPtr encodedBuffer, ref int encodedSize)
        {
            int num = 0;

            try
            {
                num = GrFingerprintProxy.EncodeBase64(buffer, bufferSize, encodedBuffer, ref encodedSize);
            }
            catch (AccessViolationException exception)
            {
                FingerprintException exception2 = new FingerprintException(-113, exception);
                throw exception2;
            }
            return(num);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        public static GrLicense GetStrGrFingerVersion(ref byte majorVersion, ref byte minorVersion)
        {
            int num = 0;

            try
            {
                num = GrFingerprintProxy.GrGetGrFingerVersion(ref majorVersion, ref minorVersion);
            }
            catch (AccessViolationException exception)
            {
                FingerprintException exception2 = new FingerprintException(-113, exception);
                throw exception2;
            }
            return((GrLicense)num);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
        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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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);
        }
コード例 #16
0
        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);
        }
コード例 #17
0
        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);
        }
コード例 #18
0
        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);
        }
コード例 #19
0
        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);
        }
コード例 #20
0
        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);
        }
コード例 #21
0
        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);
        }
コード例 #22
0
        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);
        }
コード例 #23
0
        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;
        }
コード例 #24
0
 public static bool IsBase64Encoding(IntPtr buffer, int bufferSize)
 {
     return(GrFingerprintProxy.IsBase64Encoding(buffer, bufferSize));
 }
コード例 #25
0
 public static IntPtr GetDC()
 {
     return(GrFingerprintProxy.GetDC(IntPtr.Zero));
 }
コード例 #26
0
 public static void ReleaseDC(IntPtr intPtr)
 {
     GrFingerprintProxy.ReleaseDC(IntPtr.Zero, intPtr);
 }