public int Close() { if (isOpened) { this.captureCompletedHandler = null; this.captureFingerHandler = null; this.isOpened = false; if (this.threadCaptureFinger != null) { this.threadCaptureFinger.Abort(); } for (int i = 0; i < channels; i++) { IDFprCapDll.LIVESCAN_EndCapture(i); } return(IDFprCapDll.LIVESCAN_Close()); } return(1); }
public int Open(CaptureFingerHandler captureFingerHandler, CaptureCompletedHandler captureCompletedHandler) { if (isOpened) { return(1); } try { int result = IDFprCapDll.LIVESCAN_Init(); if (result != 1) { throw new Exception(string.Format("The device is error.error code:{0}", result)); } int nChannelCount = IDFprCapDll.LIVESCAN_GetChannelCount(); if (nChannelCount <= 0) { throw new Exception("The device channel is not find."); } channelSizeDict.Clear(); for (int i = 0; i < nChannelCount; i++) { result = IDFprCapDll.LIVESCAN_SetContrast(i, 127); int x = 256, y = 360; result = IDFprCapDll.LIVESCAN_GetMaxImageSize(i, ref x, ref y); channelSizeDict.Add(i, x * y); } channels = nChannelCount; if (result == 1) { isOpened = true; } this.captureCompletedHandler = captureCompletedHandler; this.captureFingerHandler = captureFingerHandler; return(result); } catch (Exception excetion) { throw new Exception(excetion.Message); } }