C# DllImport 参数是BYTE* 怎么获取图片文件
C++动态链接库是:
函数原型 int WINAPI Well_GetPhotoData(BYTE* photoData);
功能说明 获取照片数据
参 数 photoData - 返回的照片信息缓存指针,不小于1024字节
返回值 1 - 正确
0 - 初始化失败
9 - 其他原因失败
获取照片数据函数我用byte[]、和IntPtr获取信息都失败了
[DllImport("xxx.dll", CallingConvention = CallingConvention.StdCall)]
public static extern int Well_GetPhotoData(byte[] photoData); //得到照片数据
byte[] memory = new byte[10240];
int i = idcardapi.Well_GetPhotoData(memory);
System.IO.MemoryStream ms = new System.IO.MemoryStream(memory);
System.Drawing.Image img = System.Drawing.Image.FromStream(ms);
返回报参数错误