[Visual Basic] Public Function Open() As Boolean Public Function Open(ByVal videoDevice As String) As Boolean Public Function Open(ByVal index As Integer) As Boolean
[C#] public bool Open(); public bool Open(string videoDevice); public bool Open(int index);
パラメータ
- videoDevice
- Web(USB)カメラの名称
- index
- Web(USB)カメラのインデックス
戻り値
成功の場合は true 、失敗の場合は false を返します。
解説
パラメータの videoDevice や index には GetVideoDevices
メソッドで取得されるデバイスの名称や string
型の配列のインデックスを渡します(複数ある場合はそのうちの一つ)。videoDevice や index のないメソッドを使用すると
GetVideoDevices メソッドで取得される先頭のデバイスを使用します。
戻り値が true の場合、State
プロパティが更新されます。
戻り値が false の場合、ErrorStatus プロパティには DirectX,
Step, Connect, Interface が設定されます。
注意事項
キャプチャー(Record
クラス)とプレビューを同時に行うことはできません。プレビューを行う場合は Record.Close
を実行して一旦Web(USB)カメラとの接続を閉じ、再度 Preview.Open を実行して接続してください。
参照
Preview メンバ | Newtone.ImageKit.WPF.WebCamera.Preview