M
mintb
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟是个新手刚学DELPHI,有一采集卡源程序代码想用到DELPHI上面,哪位朋友给转一转,最好能给注释一下,先谢谢了!
void CMiniDlg::OnButton5() //采集单帧存盘
{
char Temp[255];
DWORD FrameNum,Size,BufInfo;
MV_SetColorFormat(0,CF_RGB24); //设置当前板卡视频采集位数
MV_SetCaptureWindow(0,0,0,640,480); //设置采集窗口大小
MV_SetDisplayWindow(0,0,0,640,480); //设置显示窗口大小
FrameNum = MV_GetBufferSize(0,&BufInfo,&Size); //获得可为本卡作为图象数据使用的缓存BUFFER的线性首地址和大小
for(DWORD i = 0 ; i < FrameNum ; i++)
{
MV_CaptureSingle(0,i); //采集单帧
}
for(i=0 ; i < FrameNum ; i++)
{
MV_SaveToJpegFile(0,i,1,80,Temp); //Jpeg方式存储
}
MessageBox("采集单帧到内存成功!"
}
HBRUSH CMiniDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->m_hWnd==GetDlgItem(IDC_STATIC)->m_hWnd)
{
pDC->SetBkColor(RGB(0,0,0));
HBRUSH hBrush=::CreateSolidBrush(COLORREF(0x00ff00));
return hBrush;
}
hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
return hbr;
}
void CMiniDlg::OnButton6()
{
DWORD FrameNum,Size,BufInfo;
BYTE Temp[255];
LPRECT a;
a->left = 0 ;
a->top = 0 ;
a->right = 640 ;
a->bottom = 480 ;
FrameNum = MV_GetBufferSize(0,&BufInfo,&Size);
for(WORD i = 0 ; i < FrameNum ; i++)
{
MV_ReadBlock(0,i,a,Temp);
MV_EnableVGAOverlay(0);
}
}
void CMiniDlg::OnButton5() //采集单帧存盘
{
char Temp[255];
DWORD FrameNum,Size,BufInfo;
MV_SetColorFormat(0,CF_RGB24); //设置当前板卡视频采集位数
MV_SetCaptureWindow(0,0,0,640,480); //设置采集窗口大小
MV_SetDisplayWindow(0,0,0,640,480); //设置显示窗口大小
FrameNum = MV_GetBufferSize(0,&BufInfo,&Size); //获得可为本卡作为图象数据使用的缓存BUFFER的线性首地址和大小
for(DWORD i = 0 ; i < FrameNum ; i++)
{
MV_CaptureSingle(0,i); //采集单帧
}
for(i=0 ; i < FrameNum ; i++)
{
MV_SaveToJpegFile(0,i,1,80,Temp); //Jpeg方式存储
}
MessageBox("采集单帧到内存成功!"
}
HBRUSH CMiniDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->m_hWnd==GetDlgItem(IDC_STATIC)->m_hWnd)
{
pDC->SetBkColor(RGB(0,0,0));
HBRUSH hBrush=::CreateSolidBrush(COLORREF(0x00ff00));
return hBrush;
}
hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
return hbr;
}
void CMiniDlg::OnButton6()
{
DWORD FrameNum,Size,BufInfo;
BYTE Temp[255];
LPRECT a;
a->left = 0 ;
a->top = 0 ;
a->right = 640 ;
a->bottom = 480 ;
FrameNum = MV_GetBufferSize(0,&BufInfo,&Size);
for(WORD i = 0 ; i < FrameNum ; i++)
{
MV_ReadBlock(0,i,a,Temp);
MV_EnableVGAOverlay(0);
}
}