private bool EnrollImport() { int vnRet; vnRet = ObjFpReader.pisClearTptArray(contextId); if (vnRet != ObjFpReader.PISFP_OK) { ErrorDescription(ObjFpReader.INIT_PROC, ObjFpReader.CLEAR_TPT_ARRAY_FUNC, vnRet); ObjFpReader.pisDestroyContext(contextId); return(false); } for (int i = 0; i < fpDataList.Count; i++) { int identifiedID = i + 1; vnRet = ObjFpReader.pisAddTptArray(contextId, identifiedID, fpDataList[i]); if (vnRet != ObjFpReader.PISFP_OK) { ErrorDescription(ObjFpReader.INIT_PROC, ObjFpReader.ADD_TPT_ARRAY_FUNC, vnRet); ObjFpReader.pisDestroyContext(contextId); return(false); } } return(true); }
private void Exit() { StopFlag = true; if (deviceCompany == ObjFpReader.PRODUCT_HYSOON || deviceCompany == ObjFpReader.PRODUCT_TAIWAN) { ObjFpReader.pisLedControl(contextId, ObjFpReader.PISFP_BKLED, ObjFpReader.PISFP_LED_OFF); } ObjFpReader.pisCloseDevice(contextId); ObjFpReader.pisDestroyContext(contextId); gbxFpReader.Enabled = false; btnInit.Enabled = true; cbbDevice.Enabled = true; }
private void OpenDev(int index) { string vDevId = string.Empty; int vnRet; if (!GetDevIdFromListIndex(index, ref vDevId)) { MessageBox.Show(Pub.GetResText(formCode, "MsgNoDevice", "")); } vnRet = ObjFpReader.pisCreateContext(ref contextId); if (vnRet != ObjFpReader.PISFP_OK) { ErrorDescription(ObjFpReader.INIT_PROC, ObjFpReader.CREATE_CONTEXT_FUNC, vnRet); } txtInfo.Text = Pub.GetResText(formCode, "MsgOpenDevice", ""); vnRet = ObjFpReader.pisOpenDevice(contextId, vDevId); if (vnRet != ObjFpReader.PISFP_OK) { ObjFpReader.pisDestroyContext(contextId); ErrorDescription(ObjFpReader.INIT_PROC, ObjFpReader.OPEN_DEVICE_FUNC, vnRet); return; } vnRet = ObjFpReader.pisGetDeviceInfo(contextId, ObjFpReader.PISFP_PARAM_KIND_COMPANY, ref deviceCompany); if (vnRet != ObjFpReader.PISFP_OK) { deviceCompany = ObjFpReader.PRODUCT_PEFIS; } fpAreaTh = 18; noCheckCountTh = 20; int temp_DeviceCompany = deviceCompany; if (temp_DeviceCompany == ObjFpReader.PRODUCT_HYSOON || temp_DeviceCompany == ObjFpReader.PRODUCT_TAIWAN) { ObjFpReader.pisLedControl(contextId, ObjFpReader.PISFP_BKLED, ObjFpReader.PISFP_LED_ON); fpAreaTh = 17; noCheckCountTh = 20; } byte[] engineInfo = new byte[1024]; vnRet = ObjFpReader.pisGetInfo(contextId, ref engineInfo[0], ref imageWidth, ref imageHeight, ref imageRes, ref featureSize, ref templateSize); if (temp_DeviceCompany == ObjFpReader.PRODUCT_HYSOON || temp_DeviceCompany == ObjFpReader.PRODUCT_TAIWAN) { ObjFpReader.pisLedControl(contextId, ObjFpReader.PISFP_BKLED, ObjFpReader.PISFP_LED_OFF); } if (vnRet != ObjFpReader.PISFP_OK) { ObjFpReader.pisDestroyContext(contextId); ErrorDescription(ObjFpReader.INIT_PROC, ObjFpReader.GET_INFO_FUNC, vnRet); return; } picFpImage.Width = imageWidth; picFpImage.Height = imageHeight; picFpImage.Image = null; imageBuffer = new byte[picFpImage.Width * picFpImage.Height]; feature[0] = new byte[featureSize]; feature[1] = new byte[featureSize]; feature[2] = new byte[featureSize]; template = new byte[templateSize]; updatedTemplate = new byte[templateSize]; rawImgBuffer = new byte[ObjFpReader.IMPORT_RAW_IMAGE_WIDTH * ObjFpReader.IMPORT_RAW_IMAGE_HEIGHT]; memset(imageBuffer, 0x55, picFpImage.Width * picFpImage.Height); vnRet = ObjFpReader.pisSetMatchParameter(contextId, ObjFpReader.PISFP_DEFAULT_ROTATION_RANGE, ObjFpReader.PISFP_DEFAULT_THRESHOLD); if (vnRet != ObjFpReader.PISFP_OK) { ObjFpReader.pisDestroyContext(contextId); ErrorDescription(ObjFpReader.INIT_PROC, ObjFpReader.GET_INFO_FUNC, vnRet); return; } StopFlag = true; gbxFpReader.Enabled = true; GetDbFingerData(txtEmpNo.Text, txtFingerNo.Text); EnrollImport(); txtInfo.Text = Pub.GetResText(formCode, "MsgInitSuccess", ""); btnInit.Enabled = false; }