
Frame Grabber SDK (Windows-C) Developer Guide
// Set the number of internal buffers for the SDK.
nRet = MV_FG_SetBufferNum(hStream, BUFFER_NUMBER);
if (MV_FG_SUCCESS != nRet)
{
printf("Set buffer number failed! %#x\n", nRet);
break;
}
// Register the frame buffer information callback function.
nRet = MV_FG_RegisterFrameCallBack(hStream, FrameCb, hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Register frame callback failed! %#x\n", nRet);
break;
}
// Start image acquisition.
nRet = MV_FG_StartAcquisition(hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Start acquistion failed! %#x\n", nRet);
return nRet;
}
printf("Press any key to stop acquisition.\n");
WaitForKeyPress();
// Stop image acquisition.
nRet = MV_FG_StopAcquisition(hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Stop acquisition failed! %#x\n", nRet);
return nRet;
}
} while (0);
// Close stream channel.
if (NULL != hStream)
{
nRet = MV_FG_CloseStream(hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Close stream failed! %#x\n", nRet);
}
hStream = NULL;
}
// Close the device.
if (NULL != hDevice)
{
nRet = MV_FG_CloseDevice(hDevice);
116





















































































































































