C# と VB.NET の質問掲示板

ASP.NET、C++/CLI、Java 何でもどうぞ

ログ内検索
  • キーワードを複数指定する場合は 半角スペース で区切ってください。
  • 検索条件は、(AND)=[A かつ B] (OR)=[A または B] となっています。
  • [返信]をクリックすると返信ページへ移動します。
キーワード/ 検索条件 /
検索範囲/ 強調表示/ ON (自動リンクOFF)
結果表示件数/ 記事No検索/ ON
大文字と小文字を区別する

No.85276 の関連記事表示

<< 0 >>
■85276  Re[4]: カメラ台数を増やす
□投稿者/ しろ -(2017/09/30(Sat) 12:37:54)
    説明が間違ていてすみません
    開始とビデオデバイス取得画像表示のところが
    カメラを増やした時の設定方法がわかりません。
    ビデオデバイス一覧を表示する部分は多分これで
    いいともうのですが間違っているでしょうか?

    'ビデオデバイス一覧を表示する
    _videoDevices = New FilterInfoCollection(FilterCategory.VideoInputDevice)

    ComboBox1.Items.Clear()
    If _videoDevices.Count <> 0 Then
    For Each device In _videoDevices
    ComboBox1.Items.Add(device.Name)
    Next
    ComboBox1.SelectedIndex = 0
    End If
    End Sub

    Dim _videoSource As VideoCaptureDevice = Nothing

    'ビデオデバイス一覧を表示する
    _videoDevices = New FilterInfoCollection(FilterCategory.VideoInputDevice)

    ComboBox2.Items.Clear()
    If _videoDevices.Count <> 0 Then
    For Each device In _videoDevices
    ComboBox2.Items.Add(device.Name)
    Next
    ComboBox2.SelectedIndex = 0
    End If
    End Sub

    Dim _videoSource As VideoCaptureDevice = Nothing
    '[開始]
    Private Sub StartButton_Click(sender As Object, e As EventArgs) Handles StartButton.Click
    If ComboBox1.Items.Count = 0 Then
    Return
    End If

    Dim MonikerString = _videoDevices(ComboBox1.SelectedIndex).MonikerString '最初のビデオデバイスを使用

    _videoSource = New VideoCaptureDevice(MonikerString)
    AddHandler _videoSource.NewFrame, AddressOf Me.Video_NewFrame
    _videoSource.Start()
    End Sub
    'ビデオデバイス取得画像表示
    Private Sub Video_NewFrame(sender As Object, eventArgs As NewFrameEventArgs)
    Dim img = DirectCast(eventArgs.Frame.Clone(), Bitmap)
    PictureBox1.Image = img
    End Sub


記事No.85265 のレス /過去ログ146より / 関連記事表示
削除チェック/



<< 0 >>

パスワード/

- Child Tree -