| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1334 人关注过本帖
标题:摄像头取像的问题?
只看楼主 加入收藏
lht99101
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-11-24
收藏
 问题点数:0 回复次数:5 
摄像头取像的问题?
一个问题要请教:我现在用VB6.0在开发一个应用程序,需要用USB摄像头取像,保存在数据库中,我想实现能在摄像头捕捉到的画面上可以画一个矩形的透明虚线框,如果鼠标在矩形框中按下鼠标左键时候,能拖动这个虚线的矩形框来移动它。双击的时候就可以截取虚线框选中的照片了(即照片上的部分图片截取)。请赐教!!跪求!!!!!
搜索更多相关主题的帖子: 摄像头 鼠标 数据库 虚线 矩形 
2006-11-24 18:39
simpson
Rank: 3Rank: 3
等 级:论坛游民
威 望:7
帖 子:863
专家分:17
注 册:2006-11-16
收藏
得分:0 
关注
好想法

全国最大的 Java专业电子书免费分享[url]http:///in.asp?id=xrmao[/url]
2006-11-24 19:03
pljczjc
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-10-16
收藏
得分:0 
我也想要这个功能
2011-10-16 22:24
draug
Rank: 2
等 级:论坛游民
帖 子:4
专家分:10
注 册:2012-7-29
收藏
得分:0 
关注
2012-07-29 22:20
wenshuai
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-10-8
收藏
得分:0 
Private Declare Function capCreateCaptureWindow Lib "avicap32.dll" _
Alias "capCreateCaptureWindowA" ( _
ByVal lpszWindowName As String, _
ByVal dwStyle As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hWndParent As Long, _
ByVal nID As Long) As Long

Private Const WS_CHILD = &H40000000
Private Const WS_VISIBLE = &H10000000
Private Const WM_USER = &H400
Private Const WM_CAP_START = &H400
Private Const WM_CAP_EDIT_COPY = (WM_CAP_START + 30)
Private Const WM_CAP_DRIVER_CONNECT = (WM_CAP_START + 10)
Private Const WM_CAP_SET_PREVIEWRATE = (WM_CAP_START + 52)
Private Const WM_CAP_SET_OVERLAY = (WM_CAP_START + 51)
Private Const WM_CAP_SET_PREVIEW = (WM_CAP_START + 50)
Private Const WM_CAP_DRIVER_DISCONNECT = (WM_CAP_START + 11)

Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Preview_Handle As Long


Public Function CreateCaptureWindow( _
hWndParent As Long, _
Optional x As Long = 0, _
Optional y As Long = 0, _
Optional nWidth As Long = 750, _
Optional nHeight As Long = 620, _
Optional nCameraID As Long = 0) As Long

Preview_Handle = capCreateCaptureWindow("Video", _
WS_CHILD + WS_VISIBLE, x, y, _
nWidth, nHeight, hWndParent, 1)

SendMessage Preview_Handle, WM_CAP_DRIVER_CONNECT, nCameraID, 0
SendMessage Preview_Handle, WM_CAP_SET_PREVIEWRATE, 30, 0
SendMessage Preview_Handle, WM_CAP_SET_OVERLAY, 1, 0
SendMessage Preview_Handle, WM_CAP_SET_PREVIEW, 1, 0

CreateCaptureWindow = Preview_Handle
End Function


Public Function CapturePicture(nCaptureHandle As Long) As StdPicture
Clipboard.Clear
SendMessage nCaptureHandle, WM_CAP_EDIT_COPY, 0, 0
Set CapturePicture = Clipboard.GetData
End Function


Public Sub Disconnect(nCaptureHandle As Long, _
Optional nCameraID = 0)
SendMessage nCaptureHandle, WM_CAP_DRIVER_DISCONNECT, _
nCameraID, 0
End Sub

Public Sub delay(delaytime As Long)   '变量名称不能有空格
For i = 1 To delaytime
    DoEvents
Next
End Sub


2012-10-08 13:19
快速回复:摄像头取像的问题?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016444 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved