【发布时间】:2020-01-11 09:33:50
【问题描述】:
我试图通过我的 C# 代码捕获指纹。我参考了 secugen FDx Pro SDK for windows version 2.3.3.0 并安装了驱动程序。虽然我在其他 dll 文件中看不到 sgfplib.dll。
当我运行代码尝试初始化使用 sgfplib.dll 的 SGFingerPrintManager 时,它抱怨“找不到 sgfplib.dll”我已经阅读了该平台上的先前建议,但没有解决问题。
请提前感谢任何解决此问题的建议。
提前致谢。
a) 我已下载 FDx Pro SDK for windows 和 secugen 驱动程序版本 6.7 (64)。 b) 另外,我尝试将 sgfplid.dll 复制到项目的 bin 文件夹中,但问题仍然存在。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using LuggageTrackingAndBillingSystem.models;
using SecuGen.FDxSDKPro.Windows;
namespace LuggageTrackingAndBillingSystem
{
public partial class TsetForSecugen : Form
{
Int32 image_width = 200;
Int32 image_height = 300;
Int32 image_dpi = 500;
public TsetForSecugen()
{
InitializeComponent();
InitializeDedive();
}
private SGFingerPrintManager m_FPM;
SGFPMDeviceName device_name = SGFPMDeviceName.DEV_FDU03;
private void InitializeDedive()
{
//Step 1
if (RuntimePolicyHelper.LegacyV2RuntimeEnabledSuccessfully)
{
// This will load a CLR 2 mixed mode assembly
m_FPM = new SGFingerPrintManager();
}
var err = m_FPM.InitEx(image_width, image_height, image_dpi);
}
private void DrawImage(Byte[] imgData, PictureBox picBox)
{
int colorval;
Bitmap bmp = new Bitmap(image_width, image_height);
picBox.Image = (Image)bmp;
for (int i = 0; i < bmp.Width; i++)
{
for (int j = 0; j < bmp.Height; j++)
{
colorval = (int)imgData[(j * image_width) + i];
bmp.SetPixel(i, j, Color.FromArgb(colorval, colorval, colorval));
}
}
picBox.Refresh();
}
private void GetImage()
{
//Capturing Finger Image Step 3
Byte[] fp_image = new Byte[image_width * image_height];
Int32 iError;
iError = m_FPM.GetImage(fp_image);
if (iError == (Int32)SGFPMError.ERROR_NONE)
{
DrawImage(fp_image, pictureBox1);
}
}
private void TsetForSecugen_Load(object sender, EventArgs e)
{
InitializeDedive();
GetDevieInfo();
}
private void GetDevieInfo()
{
#region Det Device Info step 2
//Get Device info
SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
pInfo = new SGFPMDeviceInfoParam();
Int32 iError = m_FPM.GetDeviceInfo(pInfo);
if (iError == (Int32)SGFPMError.ERROR_NONE)
{
image_width = pInfo.ImageWidth;
image_height = pInfo.ImageHeight;
}
#endregion
}
private void button1_Click(object sender, EventArgs e)
{
GetImage();
}
}
}
实际结果:预期结果是能够抓到指纹
错误测量:标头[FDx SDK Pro.NET]。正文[找不到 sgfplib.dll]
【问题讨论】:
-
This page 提到了 C# 示例代码。你调查过吗?
标签: c#-7.0