Frame Grabber SDK (Windows-C) Developer Guide
// Start image acquisition.
nRet = MV_FG_StartAcquisition(hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Start acquistion failed! %#x\n", nRet);
return nRet;
}
g_bExit = false;
while (!g_bExit)
{
// Get the buffer handle of a frame.
nRet = MV_FG_GetImageBuffer(hStream, &hBuffer, TIMEOUT);
if (MV_FG_SUCCESS != nRet)
{
printf("Get image buffer failed! %#x\n", nRet);
continue;
}
// Get image information.
nRet = MV_FG_GetBufferInfo(hBuffer, &stFrameInfo);
if (MV_FG_SUCCESS != nRet)
{
printf("Get image info failed! %#x\n", nRet);
}
else
{
printf("FrameNumber:%2I64d%, Width:%d, Height:%d\n", stFrameInfo.nFrameID,
stFrameInfo.nWidth, stFrameInfo.nHeight);
if (nSaveImage < SAVE_IMAGE_NUM)
{
SaveRawImage(++nSaveImage, &stFrameInfo);
}
}
// Insert the buffer back to the input queue.
nRet = MV_FG_QueueBuffer(hBuffer);
if (MV_FG_SUCCESS != nRet)
{
printf("Queue buffer failed! %#x\n", nRet);
break;
}
}
// Stop image acquisition.
nRet = MV_FG_StopAcquisition(hStream);
if (MV_FG_SUCCESS != nRet)
{
printf("Stop acquisition failed! %#x\n", nRet);
return nRet;
87
    "