CamCapX 1.1

CamCapX 1.1

型式 価格(税別)
CamCapX 1.1 サポートなし \10,000
CamCapX 1.1 サポート付 \100,000

注)

弊社ハードウェア製品のみ対応です。

概要

機能

CamCapX 1.1詳細

CamCapX 1.1VB6 コード例

Private Function InitDevice() As Boolean
  Dim index As Integer
  
  InitDevice = False
  index = cbDevice.ItemData(cbDevice.ListIndex)
  CamCapX11.DeviceIndex = index
  CamCapX11.DeviceFormat = cbFormat.Text
  CamCapX11.Stop '現在のデバイスを開放
  If (CamCapX11.Start()) Then
  ' 初期化成功なら表示サイズを調整
    Dim ratio As Double
    Dim w, h As Integer
    ratio = Slider.Value / 100
    w = Round(CamCapX11.ImageWidth * ratio)
    h = Round(CamCapX11.ImageHeight * ratio)
    CamCapX11.Width = w
    CamCapX11.Height = h
    InitDevice = True
  End If
        
  If (InitDevice = False) Then
    MsgBox ("初期化に失敗しました。")
  End If
End Function

Private Sub btnCapture_Click()
  CamCapX11.Capture capPicture.hDC, capPicture.ScaleWidth, capPicture.ScaleHeight
End Sub

Private Sub btnOK_Click()
  Dim devIndex As Integer
  Dim formatIndex As Integer

  devIndex = cbDevice.ListIndex
  formatIndex = cbFormat.ListIndex
  
  If ((devIndex <> -1) And (formatIndex <> -1)) Then
    If (btnPlay.Caption = "Play") Then
      CamCapX11.Stop
      If (InitDevice) Then
        If (btnPlay.Enabled) Then
          CamCapX11.Play
        Else
          btnPlay.Enabled = True
        End If
      Else
        btnPlay.Caption = "Play"
        btnPlay.Enabled = False
      End If

    Else
      If (InitDevice) Then
        btnPlay.Enabled = True
        CamCapX11.Play
      Else
        btnPlay.Caption = "Play"
        btnPlay.Enabled = False
      End If
    End If
  End If
End Sub

Private Sub btnPlay_Click()
  If (btnPlay.Caption = "Play") Then
    CamCapX11.Play
    btnPlay.Caption = "Pause"
  Else
    CamCapX11.Pause
    btnPlay.Caption = "Play"
  End If
End Sub

Private Sub btnProperty_Click()
  CamCapX11.ShowDeviceProperty
End Sub

Private Sub btnSave_Click()
  Dim str As String
  Dim q As Integer
  
  If (btnPlay.Enabled) Then
    SaveDialog.FileName = ""
    SaveDialog.ShowSave
    If (SaveDialog.FileName <> "") Then
      q = txtQuality.Text
      CamCapX11.Quality = q
      str = SaveDialog.FileName
      CamCapX11.Save (str)
    End If
  End If
End Sub

Private Sub Form_Load()
  Dim devIndex As Integer

  ' デバイスを検索
  ' devIndex = CamCapX11.FindFirst("IUC2 MPixel PCCam", "IUCM-130", "")   ' 130万画素のみ
  ' devIndex = CamCapX11.FindFirst("", "", "")                            ' 全カメラ
  devIndex = CamCapX11.FindFirst("IUC2 MPixel PCCam", "", "")           ' IUC全機種
  While (devIndex <> -1)
    cbDevice.AddItem (CamCapX11.DeviceType + "[" + CamCapX11.DevicePort + "]")
    cbDevice.ItemData(cbDevice.NewIndex) = devIndex
    devIndex = CamCapX11.FindNext()
  Wend

  devIndex = CamCapX11.FindFirst("IUCM-31VM4A PCCam", "", "")             ' IUC-31VM4
  While (devIndex <> -1)
    cbDevice.AddItem (CamCapX11.DeviceType + "[" + CamCapX11.DevicePort + "]")
    cbDevice.ItemData(cbDevice.NewIndex) = devIndex
    devIndex = CamCapX11.FindNext()
  Wend

  devIndex = CamCapX11.FindFirst("SVU2-1.3MT PCCam", "", "")            ' SVU2-130MT
  While (devIndex <> -1)
    cbDevice.AddItem (CamCapX11.DeviceType + "[" + CamCapX11.DevicePort + "]")
    cbDevice.ItemData(cbDevice.NewIndex) = devIndex
    devIndex = CamCapX11.FindNext()
  Wend

  devIndex = CamCapX11.FindFirst("uCamHi-130 PCCam", "", "")            ' uCamHi-130
  While (devIndex <> -1)
    cbDevice.AddItem (CamCapX11.DeviceType + "[" + CamCapX11.DevicePort + "]")
    cbDevice.ItemData(cbDevice.NewIndex) = devIndex
    devIndex = CamCapX11.FindNext()
  Wend

  ' 使用デバイスがサポートしているフォーマットを指定
  ' とりあえず全て追加
  cbFormat.AddItem ("RGB 640X480")   ' 130, 300
  cbFormat.AddItem ("RGB 800X600")   ' 200
  cbFormat.AddItem ("RGB 1024X768")  ' 300
  cbFormat.AddItem ("RGB 1280X1024") ' 130, 200, 300
  cbFormat.AddItem ("RGB 1600X1200") ' 200
  cbFormat.AddItem ("RGB 2048X1536") ' 300
  cbFormat.ListIndex = 3

  If (cbDevice.ListCount <> 0) Then
    cbDevice.ListIndex = 0
  End If
  
  If (InitDevice) Then
    btnPlay.Caption = "Pause"
    CamCapX11.Play
  Else
    btnPlay.Caption = "Play"
    btnPlay.Enabled = False
  End If
End Sub

Private Sub Slider_Change()
  Dim ratio As Double
  Dim w, h As Integer
  ratio = Slider.Value / 100
  w = Round(CamCapX11.ImageWidth * ratio)
  h = Round(CamCapX11.ImageHeight * ratio)
  CamCapX11.Width = w
  CamCapX11.Height = h
End Sub