C#
VB
C++
Gets the number of items contained in the collection.
public int Count { get; } Public ReadOnly Property Count As Integer public:property int Count {int get();}
The number of items contained in the collection.
using Leadtools;using Leadtools.MediaFoundation;using LeadtoolsMediaFoundationExamples.Fixtures;public CaptureCtrlForm _form = new CaptureCtrlForm();public bool _result = false;public void CountExample(){try{// reference the form capture controlCaptureCtrl capturectrl = _form.CaptureCtrl;// reference the target formatsTargetFormats formats = capturectrl.TargetFormats;// reference the target format objectTargetFormat tf = formats[TargetFormatType.MP4];// reference the target video formats objectTargetVideoFormats tvformats = tf.VideoFormats;// get count before setting deviceint n = tvformats.Count;// set an video device first, you should use your video device name hereif (capturectrl.VideoDevices["USB"] == null)throw new Exception("No USB video device available");capturectrl.VideoDevices["USB"].Selected = true;// set out result to what we expect_result = (n > 0);}catch (Exception){_result = false;}}
Imports LeadtoolsImports Leadtools.MediaFoundationImports LeadtoolsMediaFoundationExamples.FixturesPublic _form As CaptureCtrlForm = New CaptureCtrlForm()Public _result As Boolean = FalsePublic Sub CountExample()Try' reference the form capture controlDim capturectrl As CaptureCtrl = _form.CaptureCtrl' reference the target formatsDim formats As TargetFormats = capturectrl.TargetFormats' reference the target format objectDim tf As TargetFormat = formats(TargetFormatType.MP4)' reference the target video formats objectDim tvformats As TargetVideoFormats = tf.VideoFormats' get count before setting deviceDim n As Integer = tvformats.Count' set an video device first, you should use your video device name hereIf capturectrl.VideoDevices("USB") Is Nothing ThenThrow New Exception("No USB video device available")End Ifcapturectrl.VideoDevices("USB").Selected = True' set out result to what we expect_result = (n > 0)Catch e1 As Exception_result = FalseEnd TryEnd Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
