我正在使用NITGEN 的 Finkey Hamster DX来捕捉指纹。
我已将指纹数据转换为文本格式,该格式为我提供如下字符串(以下代码中的字符串“sr”给出了此字符串):
AQAAABQAAAAEAQAAAQASAAEAZAAAAAAA*AAAAOHbWlAewfLK7kOnScKzeN5HMVcDmjce0KPkeqyeiWEdTnJutHvnhyrnkW9OPbQNQc7/94lnozdd3Zz8RKiRSj8HHdCMZ8XIdaCy0tCxp2wLwRbVrHl14QkJlQMGqeJyzu06h/ZorwN5vVoxuzFDM9dKyqlm85XHuOeoeACxO/xZrE3NdH4aesbYWgy2i5Cru2AHymemLVeu7BX5BRgFkRrx6JzcZpW9Jn0r3GOkdSqGZG85soUxNX4GN*4gJlqjfCg81cDZAi5NqiEosZjJUXwZ2677ll3OCOUaS31/7v7qF9NN1XdlNc1hrI8kQfmtbRNM3EOybwAoFTHG76rqRos
我尝试使用以下代码将此字符串转换为byte[]
数组:
textFIR = new NBioAPI.Type.FIR_TEXTENCODE();
UInt32 r = m_NBioAPI.GetTextFIRFromHandle(hCapturedFIR, out textFIR, true);
string sr = "";
if (textFIR != null)
{
sr = textFIR.TextFIR;
byte[] src = new byte[sr.Length*sizeof(char)];
System.Buffer.BlockCopy(sr.ToCharArray(),0,src,0,src.Length);
MemoryStream ms = new MemoryStream(src);
System.Drawing.Image FP = System.Drawing.Image.FromStream(ms);
FP.Save("G:\\TempFP.Jpeg", ImageFormat.Jpeg);
}
但是Image.FromStream(ms)
我得到“参数无效”。例外。