frmCaptureRate.frm
上传用户:szlwled
上传日期:2022-06-30
资源大小:95k
文件大小:3k
源码类别:

视频捕捉/采集

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form frmCaptureRate 
  3.    Caption         =   "设置帧率"
  4.    ClientHeight    =   2025
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   4290
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2025
  10.    ScaleWidth      =   4290
  11.    StartUpPosition =   3  '窗口缺省
  12.    Begin VB.CommandButton cmdExit 
  13.       Caption         =   "退出"
  14.       Height          =   495
  15.       Left            =   2280
  16.       TabIndex        =   4
  17.       Top             =   1080
  18.       Width           =   1215
  19.    End
  20.    Begin VB.CommandButton cmdOK 
  21.       Caption         =   "确定"
  22.       Height          =   495
  23.       Left            =   840
  24.       TabIndex        =   3
  25.       Top             =   1080
  26.       Width           =   1215
  27.    End
  28.    Begin VB.VScrollBar VScroll1 
  29.       Height          =   270
  30.       Left            =   2880
  31.       Max             =   1
  32.       Min             =   100
  33.       TabIndex        =   2
  34.       Top             =   315
  35.       Value           =   1
  36.       Width           =   255
  37.    End
  38.    Begin VB.TextBox txtRate 
  39.       Alignment       =   1  'Right Justify
  40.       Height          =   270
  41.       Left            =   2280
  42.       TabIndex        =   1
  43.       Text            =   "15"
  44.       Top             =   315
  45.       Width           =   615
  46.    End
  47.    Begin VB.Label Label1 
  48.       AutoSize        =   -1  'True
  49.       Caption         =   "设置捕获帧率:"
  50.       Height          =   180
  51.       Left            =   960
  52.       TabIndex        =   0
  53.       Top             =   360
  54.       Width           =   1260
  55.    End
  56. End
  57. Attribute VB_Name = "frmCaptureRate"
  58. Attribute VB_GlobalNameSpace = False
  59. Attribute VB_Creatable = False
  60. Attribute VB_PredeclaredId = True
  61. Attribute VB_Exposed = False
  62. Private Sub cmdExit_Click() '“退出”按钮
  63.     Unload Me   '卸载窗体
  64. End Sub
  65. Private Sub cmdOK_Click()   '“确定”按钮
  66.     Dim i As Integer
  67.     i = Val(txtRate.Text)   '获取文本框中的值
  68.     If i <= 0 Then Exit Sub
  69.     If i > 100 Then i = 100 '若输入的值超过100
  70.     frmCamera.ezVidCap1.CaptureRate = Val(txtRate.Text) '设置帧率
  71.     Unload Me   '卸载当前窗体
  72. End Sub
  73. Private Sub Form_Load()
  74.     txtRate.Text = frmCamera.ezVidCap1.CaptureRate  '显示原有帧率
  75.     VScroll1.Value = Val(txtRate.Text)  '设置滚动条的值
  76. End Sub
  77. Private Sub txtRate_KeyPress(KeyAscii As Integer)   '设置只能输入0~9的数字
  78.     If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Then   '若输入的是0~9
  79.     Else
  80.         KeyAscii = 0    '否则取消输入内容
  81.     End If
  82. End Sub
  83. Private Sub txtRate_Validate(Cancel As Boolean)
  84.     Dim i As Integer
  85.     On Error Resume Next
  86.     i = Val(txtRate.Text)   '获取文本框中的值
  87.     If i <= 0 Then Exit Sub '若输入值小于等于0,则退出过程
  88.     If i > 100 Then i = 100 '若输入值大于100,则设置为100
  89.     VScroll1.Value = Val(txtRate.Text)  '将输入值保存到滚动条
  90. End Sub
  91. Private Sub VScroll1_Change()   '滚动条改变事件
  92.     txtRate.Text = VScroll1.Value   '改变文本框的值
  93. End Sub