frmCamera.frm
上传用户:szlwled
上传日期:2022-06-30
资源大小:95k
文件大小:3k
- VERSION 5.00
- Object = "{DF6D6558-5B0C-11D3-9396-008029E9B3A6}#1.0#0"; "ezvidC60.ocx"
- Begin VB.Form frmCamera
- Caption = "录制视频"
- ClientHeight = 2295
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 3150
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 2295
- ScaleWidth = 3150
- Begin vbVidC60.ezVidCap ezVidCap1
- Height = 1800
- Left = 240
- TabIndex = 0
- Top = 240
- Width = 2400
- _ExtentX = 4233
- _ExtentY = 3175
- CenterVideo = 0 'False
- MakeUserConfirmCapture= 0
- AbortLeftMouse = 0
- AbortRightMouse = 0
- YieldEventEnabled= -1 'True
- FrameEventEnabled= -1 'True
- UsePreciseCaptureControls= -1 'True
- End
- End
- Attribute VB_Name = "frmCamera"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub ezVidCap1_CaptureYield() '捕获事件
- DoEvents
- End Sub
- Private Sub ezVidCap1_ErrorMessage(ByVal ErrCode As Long, ByVal ErrString As String)
- '捕获错误信息
- If ErrCode <> 0 Then '若有错误
- frmMain.sbStatusBar.Panels(1) = "错误:" & ErrString '在状态栏显示错误信息
- End If
- End Sub
- Private Sub ezVidCap1_PreRollComplete() '准备开始录制
- Dim lRet As Long
- lRet = MsgBox("单击“确定”按钮开始录制!", vbOKCancel, App.Title) '显示确认信息
- If lRet = vbOK Then '单击“确定”按钮
- ezVidCap1.PreciseCaptureStart '开始录制
- Else '单击“取消”按钮
- ezVidCap1.PreciseCaptureCancel '放弃录制
- End If
- End Sub
- Private Sub ezVidCap1_StatusMessage(ByVal StatCode As Long, ByVal StatString As String)
- '捕获状态事件
- If StatCode <> 0 Then '状态码不为0
- frmMain.sbStatusBar.Panels(1).Text = Left(StatString, InStr(StatString, ")")) '显示状态信息
- If StatCode = 301 Then '若是结束状态
- frmMain.mnuRecStart.Caption = "开始录制" '修改菜单标题
- frmCamera.Hide '隐藏摄像头窗体
- frmVideo.Show '显示预览窗体
- End If
- End If
- DoEvents
- End Sub
- Private Sub Form_Activate()
- Me.Width = Me.ezVidCap1.Left + Me.ezVidCap1.Width + 400 '设置窗体宽度
- Me.Height = Me.ezVidCap1.Top + Me.ezVidCap1.Height + 800 '设置窗体高度
- Me.ezVidCap1.Preview = True '打开摄像头控件的预览
- Me.ezVidCap1.PreviewRate = 15 '设置预览速度
- End Sub