try
{
String strAreaMap = null;
int iSizeOfMap = 0;
int iPersistTime = 5;
int iDetectWidth = axSDK3000.Width / 16;
int iDetectHeight = axSDK3000.Height / 16;
int nDetectBlocks = iDetectWidth * iDetectHeight;
MotionDetect md = PrcCbMotionDetect;
int iPtFuntion = (int)Marshal.GetFunctionPointerForDelegate(md);
strAreaMap = new String('c', 48);
axSDK3000.EnableMotionDetect(strAreaMap, nDetectBlocks, iPersistTime, iPtFuntion);
// 最后一个参数要取到函数的句柄,我用这个方法实现的,报
.VSHOST.EXE中发生未处理的win32异常
}
catch (Exception exEc)
{
MessageBox.Show(exEc.Message);
}
private delegate void MotionDetect();
public void PrcCbMotionDetect()
{
string g_strPicturePath = Application.StartupPath;
axSDK3000.SaveImageToBmp(g_strPicturePath + "motion.bmp", 1, false);
}