海康采集卡截图问题
我用海康采集卡的Demo的部分程序编了个抓图程序。为什么连上摄像头抓图出现“Not enough memory to store bitstream!or Image is too complex!”
抓图需要编写回调函数吗?
void CVideoPreviewDlg::OnSnap()
{
// TODO: Add your control notification handler code here
UCHAR imageBuf[352 * 288*2];
DWORD Size = 352 * 288*2;
UCHAR *imageBuffer=new UCHAR[Size];
char fileName[256];
CTime m_StartTime1=CTime::GetCurrentTime();
CString csStartTime=m_StartTime1.Format("%Y%m%d%H%M%S");
int jpegQuality=100;
{
//capture BMP picture
TRACE("start original image cap\n");
sprintf(fileName, "c:\\ch%02d_%s.bmp", 0,csStartTime);
GetOriginalImage(ChannelHandle[0], imageBuf, &Size);
SaveYUVToBmpFile(fileName, imageBuf, 352, 288);
delete []imageBuffer;
Sleep(10);
}
}