我一直在開發一個小應用程序,用于在掃描 3 次后獲取指紋。我使用了 ZKFingerSDK,當嘗試獲取注冊指紋時,它會將圖像恢復為黑色。我使用的是ZK9500設備if (RegisterCount >= REGISTER_FINGER_COUNT && !bIdentify){ RegisterCount = 0; ret = GenerateRegisteredFingerPrint(); // <--- GENERATE FINGERPRINT TEMPLATE if (zkfp.ZKFP_ERR_OK == ret) { ret = AddTemplateToMemory(); // <--- LOAD TEMPLATE TO MEMORY if (zkfp.ZKFP_ERR_OK == ret) // <--- ENROLL SUCCESSFULL { string fingerPrintTemplate = string.Empty; zkfp.Blob2Base64String(newRegTmp, cbCapTmp, ref fingerPrintTemplate); newRegTmp = zkfp.Base64String2Blob(fingerPrintTemplate); Bitmap bmp2; MemoryStream ms2 = new MemoryStream(); BitmapFormat.GetBitmap(newRegTmp, mfpWidth, mfpHeight, ref ms2); bmp2 = new Bitmap(ms2); this.pictureBox1.Image = bmp2; Console.WriteLine("finger print" + fingerPrintTemplate); textRes.AppendText("merged " + fingerPrintTemplate + "\n"); } }}
1 回答

森林海
TA貢獻2011條經驗 獲得超2個贊
我假設ret = AddTemplateToMemory();
將模板加載到 newRegTmp 中。
zkfp.Blob2Base64String(newRegTmp, cbCapTmp, ref fingerPrintTemplate);
從這一行我了解到您在 newRegTmp 處擁有指紋的原始數據,并且您正在將 cbCapTmp 的大小提取到 FingerPrintTemplate 中。
在這種情況下,您不應在下一行中使用 newRegTmp newRegTmp =zkfp.Base64String2Blob(fingerPrintTemplate);
,這會用 Base64 字符串覆蓋實際數據。您可以使用 Base64 字符串在帶有 img 標簽的網頁上顯示圖像。但要將原始數據轉換為圖像,您需要將實際數據傳遞給 GetBitMap。
如果上述建議不起作用,請分享AddTemplateToMemory的實現。
- 1 回答
- 0 關注
- 251 瀏覽
添加回答
舉報
0/150
提交
取消