Machine Vision Camera SDK (C) Developer Guide
else//Only for upcoming
{
nRet = MV_CC_GetImageBuffer(handle, &stOutFrame, 5000);
if (nRet == MV_OK)
{
printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]\n",
stOutFrame.stFrameInfo.nWidth,
stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nFrameNum);
nRet = MV_CC_FreeImageBuffer(handle, &stOutFrame);
if(nRet != MV_OK)
{
printf("Free Image Buffer fail! nRet [0x%x]\n", nRet);
}
}
else
{
printf("No data[0x%x]\n", nRet);
}
}
//Stop grabbing image
nRet = MV_CC_StopGrabbing(handle);
if (MV_OK != nRet)
{
printf("Stop Grabbing fail! nRet [0x%x]\n", nRet);
break;
}
//Close device
nRet = MV_CC_CloseDevice(handle);
if (MV_OK != nRet)
{
printf("Close Device fail! nRet [0x%x]\n", nRet);
break;
}
//Destroy handle
nRet = MV_CC_DestroyHandle(handle);
if (MV_OK != nRet)
{
printf("Destroy Handle fail! nRet [0x%x]\n", nRet);
break;
}
} while (0);
if (nRet != MV_OK)
{
if (handle != NULL)
{
MV_CC_DestroyHandle(handle);
handle = NULL;
55
    "