⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmvideosize.frm

📁 vb编写机器人遥控程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmVideoSize 
   Caption         =   "视频尺寸"
   ClientHeight    =   2610
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   3975
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   ScaleHeight     =   2610
   ScaleWidth      =   3975
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox txtHeight 
      Height          =   300
      Left            =   2880
      TabIndex        =   3
      Text            =   "240"
      Top             =   1440
      Width           =   615
   End
   Begin VB.TextBox txtWidth 
      Height          =   300
      Left            =   2040
      TabIndex        =   2
      Text            =   "320"
      Top             =   1440
      Width           =   615
   End
   Begin VB.ComboBox cboSize 
      Height          =   300
      Left            =   2040
      TabIndex        =   1
      Text            =   "320*240"
      Top             =   960
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Caption         =   "视频设置"
      Height          =   2415
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3735
      Begin VB.OptionButton OptDefine 
         Caption         =   "自定义尺寸:"
         Height          =   255
         Left            =   360
         TabIndex        =   9
         Top             =   1320
         Width           =   1455
      End
      Begin VB.OptionButton OptStardard 
         Caption         =   "标准视频尺寸"
         Height          =   255
         Left            =   360
         TabIndex        =   8
         Top             =   840
         Value           =   -1  'True
         Width           =   1455
      End
      Begin VB.CheckBox cekV 
         Caption         =   "垂直镜像"
         Height          =   255
         Left            =   1920
         TabIndex        =   7
         Top             =   360
         Width           =   1095
      End
      Begin VB.CheckBox cekH 
         Caption         =   "水平镜像"
         Height          =   255
         Left            =   360
         TabIndex        =   6
         Top             =   360
         Width           =   1095
      End
      Begin VB.CommandButton cmdCancel 
         Caption         =   "取消"
         Height          =   375
         Left            =   2040
         TabIndex        =   5
         Top             =   1800
         Width           =   975
      End
      Begin VB.CommandButton cmdOk 
         Caption         =   "确定"
         Height          =   375
         Left            =   600
         TabIndex        =   4
         Top             =   1800
         Width           =   975
      End
   End
End
Attribute VB_Name = "frmVideoSize"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cekH_Click()
    Dim mirror As Long
    If Me.cekH.Value = 1 Then
        mirror = 1
        m_ish = True
    Else
        mirror = 0
        m_ish = False
    End If
    devwdm_SetMirror m_CardID, mirror, 0
    
End Sub

Private Sub cekV_Click()
    Dim mirror As Long
    If Me.cekV.Value = 1 Then
        mirror = 1
        m_isv = True
    Else
        mirror = 0
        m_isv = False
    End If
    devwdm_SetFlip m_CardID, mirror, 0
    m_isv = True
End Sub

Private Sub cmdCancel_Click()
   Unload Me
End Sub

Private Sub cmdOk_Click()
  If OptStardard.Value = True Then
    If isDataCopy Then Unload frmDataCallBack
    If cboSize.ListIndex = -1 Then cboSize.ListIndex = 0
    Select Case cboSize.ListIndex
        Case 0:
           frmMain.m_Video.Width = 320 * 12
           frmMain.m_Video.Height = 240 * 12
           Call devwdm_CloseCard(m_CardID)
           Call devwdm_InitCard(m_CardID, frmMain.m_Video.hwnd, 320, 240)
           m_Width = 320
           m_Height = 240
        Case 1:
           frmMain.m_Video.Width = 352 * 12
           frmMain.m_Video.Height = 288 * 12
           Call devwdm_CloseCard(m_CardID)
           Call devwdm_InitCard(m_CardID, frmMain.m_Video.hwnd, 352, 288)
           m_Width = 352
           m_Height = 288
        Case 2:
           frmMain.m_Video.Width = 640 * 12
           frmMain.m_Video.Height = 480 * 12
           Call devwdm_CloseCard(m_CardID)
           Call devwdm_InitCard(m_CardID, frmMain.m_Video.hwnd, 640, 480)
           m_Width = 640
           m_Height = 480
        Case 3:
           frmMain.m_Video.Width = 768 * 12
           frmMain.m_Video.Height = 576 * 12
           Call devwdm_CloseCard(m_CardID)
           Call devwdm_InitCard(m_CardID, frmMain.m_Video.hwnd, 768, 576)
           m_Width = 768
           m_Height = 576
   End Select
   
   Call devwdm_StartVideoPreview(m_CardID)
   Call devwdm_RouteOutPin(m_CardID, 2)
   frmMain.StatusBar1.Panels.Item(3).Text = "现在图象的大小是 " & CStr(m_Width) & "X" & CStr(m_Height)
    isDataCopy = False
  End If
  
  If Me.OptDefine.Value = True Then
         If Not IsNumeric(Val(txtWidth.Text)) Then
             MsgBox "请输入数字", vbInformation, "提示"
             Exit Sub
         Else
             If (Val(txtWidth.Text)) > 768 Or (Val(txtWidth.Text)) < 160 Then
                 MsgBox "请输入小于720和大于160的宽度尺寸", "提示!"
                 Exit Sub
             End If
         End If
         If Not IsNumeric(Val(txtHeight.Text)) Then
             MsgBox "请输入数字", vbInformation, "提示"
             Exit Sub
         Else
             If (Val(txtHeight.Text)) > 576 Or (Val(txtHeight.Text)) < 120 Then
                 MsgBox "请输入小于576和大于120的宽度尺寸", "提示!"
                 Exit Sub
             End If
         End If
         If isDataCopy Then Unload frmDataCallBack
          frmMain.m_Video.Width = Val(txtWidth.Text) * 12
          frmMain.m_Video.Height = Val(txtHeight.Text) * 12
          Call devwdm_CloseCard(m_CardID)
          Call devwdm_InitCard(m_CardID, frmMain.m_Video.hwnd, Val(txtWidth.Text), Val(txtHeight.Text))
        
          Call devwdm_StartVideoPreview(m_CardID)
          Call devwdm_RouteOutPin(m_CardID, 2)
           m_Width = Val(txtWidth.Text)
           m_Height = Val(txtHeight.Text)
           frmMain.StatusBar1.Panels.Item(3).Text = "现在图象的大小是 " & txtWidth.Text & "X" & txtHeight.Text
           isDataCopy = False
   End If
   Unload Me
End Sub

Private Sub Form_Load()
   cboSize.ListIndex = -1
   frmVideoSize.cboSize.AddItem "320*240"
   frmVideoSize.cboSize.AddItem "352*288"
   frmVideoSize.cboSize.AddItem "640*480"
   frmVideoSize.cboSize.AddItem "768*576"
   If m_ish Then Me.cekH.Value = 1
   If m_isv Then Me.cekV.Value = 1
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -