
Frame Grabber SDK (Windows-C) Developer Guide
if (stSaveBitmapInfo.nBmpBufSize < nSize)
{
if (stSaveBitmapInfo.pBmpBuf)
{
free (stSaveBitmapInfo.pBmpBuf);
stSaveBitmapInfo.pBmpBuf = NULL;
}
stSaveBitmapInfo.pBmpBuf = (unsigned char*)malloc(nSize);
if (NULL == stSaveBitmapInfo.pBmpBuf)
{
printf("malloc pConvertData fail!\n");
nRet = MV_FG_ERR_RESOURCE_EXHAUSTED;
break;
}
stSaveBitmapInfo.nBmpBufSize = nSize;
}
stSaveBitmapInfo.nBmpBufLen = 0;
stSaveBitmapInfo.enCfaMethod = MV_FG_CFA_METHOD_OPTIMAL;
nRet = MV_FG_SaveBitmap(hStream, &stSaveBitmapInfo);
if (MV_FG_SUCCESS != nRet)
{
printf("MV_FG_SaveBitmap info failed! %#x\n", nRet);
}
else
{
SaveBitImage(stSaveBitmapInfo.pBmpBuf,
stSaveBitmapInfo.nBmpBufLen);
}
}
}
// Insert the buffer back to the input queue.
nRet = MV_FG_ReleaseFrameBuffer(hStream, &stFrameInfo);
if (MV_FG_SUCCESS != nRet)
{
printf("Release frame buffer failed! %#x\n", nRet);
break;
}
}
if (stSaveBitmapInfo.pBmpBuf)
{
free(stSaveBitmapInfo.pBmpBuf);
stSaveBitmapInfo.pBmpBuf = NULL;
}
// Stop image acquisition.
nRet = MV_FG_StopAcquisition(hStream);
if (MV_FG_SUCCESS != nRet)
{
78





















































































































































