USB摄像头拍照程序

hurry281 2008-05-22 04:13:06
大侠们好:
    我想做一个用USB摄像头拍照的程序,并且能够设置分辨率,请问该怎么做啊,谁有示例,给发个,谢谢.hurrylove2003@163.com
...全文
366 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
melos 2012-02-03
  • 打赏
  • 举报
回复
先留个名。。。。
hurry281 2008-05-28
  • 打赏
  • 举报
回复
谢谢了
beautifulmouse 2008-05-27
  • 打赏
  • 举报
回复
发错了,那个是抓拍的代码:
这个是完整的
http://blog.csdn.net/beautifulmouse/archive/2008/05/27/2486254.aspx
beautifulmouse 2008-05-27
  • 打赏
  • 举报
回复
我用的是VB
Dim FileName As String
Dim retVal As Boolean
FileName = "c:\001.bmp"
capFileSaveDIB(lwndC, FileName)

其他代码:
Function capFileSaveDIB(ByVal hCapWnd As Long, ByVal FilePath As String) As Boolean
capFileSaveDIB = SendMessageS(hCapWnd, WM_CAP_FILE_SAVEDIB, 0&, FilePath)
End Function

Declare Function SendMessageS Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As String) As Long
draculacsdn 2008-05-23
  • 打赏
  • 举报
回复
那就VFW,非常简单。
RECT rect;
GetDlgItem(nId)->GetWindowRect(&rect);
ScreenToClient(&rect);
// TODO: Add extra initialization here
hWndC = capCreateCaptureWindow (NULL,WS_CHILD | WS_VISIBLE,
rect.left, rect.top, rect.right-rect.left , rect.bottom- rect.top,
this->m_hWnd/*GetDlgItem(nId)->m_hWnd*/, 1);
if(hWndC==NULL)
{
ZcMessage.DoModal("视频窗口初始化失败");
return TRUE; // return TRUE unless you set the focus to a control
}
LRESULT res = ::SendMessage(hWndC, WM_CAP_DRIVER_CONNECT, 0, 0L);
if(res==0)
{
capDriverDisconnect (hWndC);
::ShowWindow(hWndC,SW_HIDE);
hWndC = NULL;
ZcMessage.DoModal("视频窗口初始化失败");
return FALSE;
}
capPreviewRate(hWndC, 66); // rate, in milliseconds

capPreview(hWndC, TRUE); // starts preview
capPreviewScale(hWndC,TRUE);//
capSetCallbackOnFrame(hWndC,fpFrameCallback);



////////////////////
capFileSaveDIB(hWndC, mOutFileName.GetBuffer(0));

hurry281 2008-05-22
  • 打赏
  • 举报
回复
我现在就想做一简单的能够从摄相头中拍照的功能,并把这个拍下来的图片保存起来
rageliu 2008-05-22
  • 打赏
  • 举报
回复
VFW
DirectShow

google 采集等 许多现成的代码
scq2099yt 2008-05-22
  • 打赏
  • 举报
回复
up

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧