frmCaptureRate.frm
上传用户:szlwled
上传日期:2022-06-30
资源大小:95k
文件大小:3k
- VERSION 5.00
- Begin VB.Form frmCaptureRate
- Caption = "设置帧率"
- ClientHeight = 2025
- ClientLeft = 60
- ClientTop = 450
- ClientWidth = 4290
- LinkTopic = "Form1"
- ScaleHeight = 2025
- ScaleWidth = 4290
- StartUpPosition = 3 '窗口缺省
- Begin VB.CommandButton cmdExit
- Caption = "退出"
- Height = 495
- Left = 2280
- TabIndex = 4
- Top = 1080
- Width = 1215
- End
- Begin VB.CommandButton cmdOK
- Caption = "确定"
- Height = 495
- Left = 840
- TabIndex = 3
- Top = 1080
- Width = 1215
- End
- Begin VB.VScrollBar VScroll1
- Height = 270
- Left = 2880
- Max = 1
- Min = 100
- TabIndex = 2
- Top = 315
- Value = 1
- Width = 255
- End
- Begin VB.TextBox txtRate
- Alignment = 1 'Right Justify
- Height = 270
- Left = 2280
- TabIndex = 1
- Text = "15"
- Top = 315
- Width = 615
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "设置捕获帧率:"
- Height = 180
- Left = 960
- TabIndex = 0
- Top = 360
- Width = 1260
- End
- End
- Attribute VB_Name = "frmCaptureRate"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdExit_Click() '“退出”按钮
- Unload Me '卸载窗体
- End Sub
- Private Sub cmdOK_Click() '“确定”按钮
- Dim i As Integer
- i = Val(txtRate.Text) '获取文本框中的值
- If i <= 0 Then Exit Sub
- If i > 100 Then i = 100 '若输入的值超过100
- frmCamera.ezVidCap1.CaptureRate = Val(txtRate.Text) '设置帧率
- Unload Me '卸载当前窗体
- End Sub
- Private Sub Form_Load()
- txtRate.Text = frmCamera.ezVidCap1.CaptureRate '显示原有帧率
- VScroll1.Value = Val(txtRate.Text) '设置滚动条的值
- End Sub
- Private Sub txtRate_KeyPress(KeyAscii As Integer) '设置只能输入0~9的数字
- If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Then '若输入的是0~9
- Else
- KeyAscii = 0 '否则取消输入内容
- End If
- End Sub
- Private Sub txtRate_Validate(Cancel As Boolean)
- Dim i As Integer
- On Error Resume Next
- i = Val(txtRate.Text) '获取文本框中的值
- If i <= 0 Then Exit Sub '若输入值小于等于0,则退出过程
- If i > 100 Then i = 100 '若输入值大于100,则设置为100
- VScroll1.Value = Val(txtRate.Text) '将输入值保存到滚动条
- End Sub
- Private Sub VScroll1_Change() '滚动条改变事件
- txtRate.Text = VScroll1.Value '改变文本框的值
- End Sub