c#中 DWORD,PDWORD, LPBYTE,等怎么转成C#使用的类型
在C中使用如下:intcapGetPicture(intindex,/*[IN]Cameraindex*/unsignedchar*pFrameBuf,/*[OUT]Lo...
在C中使用如下:
int capGetPicture(
int index,/* [IN] Camera index */
unsigned char *pFrameBuf, /* [OUT] Long pointer to the buffer that will receive the video frame */
unsigned int bufferLen, /* [IN] Size, in bytes, of the buffer pointed to by pFrameBuf */
unsigned char *pJpgBuf, /* [OUT] Long pointer to the buffer that will receive the jpeg picture */
unsigned int jpgLen, /* [IN] Size, in bytes, of the buffer pointed to by pJpgBuf */
PDWORD pdwActualOut /* [OUT] Pointer to an array of the return lengths */
);
。。。。
DWORD dwRtn[2] = {0};
。。。。
dwRtn[0] = dwRtn[1] = 0;
LPBYTE jpg_buf =(LPBYTE)malloc(40960);
......
capGetPicture(0, rgb_buf, rgb_size, jpg_buf, jpg_size, dwRtn);
.....
这是在C中使用该函数是变量的一些类型,现在我要用C#编程,需要dllimport,如下,但是不知道怎么设置各种参数,并且在代码中怎么如何建立变量来使用函数,哪位大侠帮忙看看一下吧,有分送哦。
DllImport("zc030xlib.dll", EntryPoint = "capGetPicture")]
public static extern int capGetPicture(
还是不成,看来只能找专门为C#使用的dll了 展开
int capGetPicture(
int index,/* [IN] Camera index */
unsigned char *pFrameBuf, /* [OUT] Long pointer to the buffer that will receive the video frame */
unsigned int bufferLen, /* [IN] Size, in bytes, of the buffer pointed to by pFrameBuf */
unsigned char *pJpgBuf, /* [OUT] Long pointer to the buffer that will receive the jpeg picture */
unsigned int jpgLen, /* [IN] Size, in bytes, of the buffer pointed to by pJpgBuf */
PDWORD pdwActualOut /* [OUT] Pointer to an array of the return lengths */
);
。。。。
DWORD dwRtn[2] = {0};
。。。。
dwRtn[0] = dwRtn[1] = 0;
LPBYTE jpg_buf =(LPBYTE)malloc(40960);
......
capGetPicture(0, rgb_buf, rgb_size, jpg_buf, jpg_size, dwRtn);
.....
这是在C中使用该函数是变量的一些类型,现在我要用C#编程,需要dllimport,如下,但是不知道怎么设置各种参数,并且在代码中怎么如何建立变量来使用函数,哪位大侠帮忙看看一下吧,有分送哦。
DllImport("zc030xlib.dll", EntryPoint = "capGetPicture")]
public static extern int capGetPicture(
还是不成,看来只能找专门为C#使用的dll了 展开
1个回答
展开全部
DllImport("zc030xlib.dll", EntryPoint = "capGetPicture")]
public static extern int capGetPicture(int index, StringBuilder pFrameBuf, uint bufferLen, StringBuilder pJpgBuf uint jpgLen, ref uint pdwActualOut);
试试
public static extern int capGetPicture(int index, StringBuilder pFrameBuf, uint bufferLen, StringBuilder pJpgBuf uint jpgLen, ref uint pdwActualOut);
试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询