请问下段C语言函数成名如何转成VB的?海康威视SDK二次开发
最近在用海康威视的板卡搞开发,他们SDK是C语言的,其中获取原始图像函数部分是这样的:
1 注册回调函数:int __stdcall RegisterImageStreamCallback(IMAGE_STREAM_CALLBACK ImageStreamCallback,void *context) 参数:IMAGE_STREAM_CALLBACK:原始图像数据流回调函数,Void *context: 设备上下文2 回调函数:typedef void(*IMAGE_STREAM_CALLBACK)(UNIT channelNumber,void *context)3 开启数据捕获:int __stdcall SetImageStream(HANDLE hChannel,BOOL bStart,UINT fps,UINT width,UINT height,unsigned char *ImageBuffer)
Private Declare Function RegisterImageStreamCallback Lib "DS40xxSDK.dll" (ImageStreamCallBack As Long, ByVal Context As Long) As LongPrivate Declare Function SetImageStream Lib "DS40xxSDK.dll" (ByVal hChannel As Long, ByVal bStart As Boolean, ByVal fps As Long, ByVal Width As Long, ByVal Height As Long, ImageBuffer As Long) As Long
Public Sub StartVideo() Dim Ret As Long, Data() As Long ReDim Data(99999) Ret = RegisterImageStreamCallback(AddressOf ImageStreamCallBack, Form1) Debug.Print "callback ret is :" & Ret Ret = SetImageStream(m_hChannel, True, 0, 704, 576, Data(0)) Debug.Print "StartVideo ret is :" & RetEnd SubPublic Function ImageStreamCallBack(ByVal ChannelNum As Long, ByVal Context As Long) Debug.Print "获取到了图像数据" & ChannelNum DoEvents Debug.Print Time End Function