
Machine Vision Camera SDK (C) Developer Guide
//The frequency of calling this interface should be controlled by upper
layer application according to frame rate.
//The codes are for reference only. In practical application, it is
recommended to create a new thread for image acquisition and processing.
while(1)
{
if (nTestFrameSize > 99)
{
break;
}
nRet = MV_CC_GetOneFrameEx(m_handle,g_pFrameBuf, MAX_BUF_SIZE, &stInfo);
if (MV_OK != nRet)
{
Sleep(10);
}
else
{
//...Image data processing
nTestFrameSize++;
}
}
//...other processing
//Stop image acquiring
nRet = MV_CC_StopGrabbing(m_handle);
if (MV_OK != nRet)
{
printf("error: StopGrabbing fail [%x]\n", nRet);
return;
}
//Shut device and release resource
nRet = MV_CC_CloseDevice(m_handle);
if (MV_OK != nRet)
{
printf("error: CloseDevice fail [%x]\n", nRet);
return;
}
//Destroy handle and release resource
nRet = MV_CC_DestroyHandle(m_handle);
if (MV_OK != nRet)
{
printf("error: DestroyHandle fail [%x]\n", nRet);
return;
}
}
150



































































































































































































































































































































































































