Imports Leadtools
Imports Leadtools.MediaFoundation
Imports LeadtoolsMediaFoundationExamples.Fixtures
Public _result AsBoolean = FalsePublic _form As CaptureCtrlForm = New CaptureCtrlForm()
PublicSub CurrentExample()
' reference the capture control and it's video inputs
Dim capturectrl As CaptureCtrl = _form.CaptureCtrl
' set a video device first, you should use your video device name here
If capturectrl.VideoDevices("Analog") IsNothingThenThrowNew Exception("No Analog video tuner device available")
EndIf
capturectrl.VideoDevices("Analog").Selected = TrueDim devices As Devices = capturectrl.VideoDevices
Try' enumerate through the list of inputs
' demonstrating the current property
ForEach dev As Device In devices
' set the result to what we expect
_result = (dev Is devices.Current)
Next dev
Catch e1 As Exception
_result = FalseEndTryEnd Sub
using Leadtools;
using Leadtools.MediaFoundation;
using LeadtoolsMediaFoundationExamples.Fixtures;
publicbool _result = false;
public CaptureCtrlForm _form = new CaptureCtrlForm();
publicvoid CurrentExample()
{
// reference the capture control and it's video inputs
CaptureCtrl capturectrl = _form.CaptureCtrl;
// set a video device first, you should use your video device name here
if (capturectrl.VideoDevices["Analog"] == null)
thrownew Exception("No Analog video tuner device available");
capturectrl.VideoDevices["Analog"].Selected = true;
Devices devices = capturectrl.VideoDevices;
try
{
// enumerate through the list of inputs
// demonstrating the current property
foreach (Device dev in devices)
{
// set the result to what we expect
_result = (dev == devices.Current);
}
}
catch (Exception)
{
_result = false;
}
}