Imports Leadtools
Imports Leadtools.MediaFoundation
Imports LeadtoolsMediaFoundationExamples.Fixtures
Public _result AsBoolean = FalsePublic _form As PlayCtrlForm = New PlayCtrlForm()
PublicSub SelectProcessorsExample()
' reference the play control
Dim playctrl As PlayCtrl = _form.PlayCtrl
Try' get the available video processors
Dim allProcs As VideoProcessors = playctrl.VideoProcessors
' get the available video processors
Dim selProcs As VideoProcessors = playctrl.SelectedVideoProcessors
' get the count of selected video processors
Dim n AsInteger = selProcs.Count
' get index of lead video Stabilizer transform
Dim nIndex AsInteger = allProcs.IndexOf("{E2B6EDDE-38C5-11D5-91F6-00104BDB8FF9}")
' add the lead video Stabilizer transform to the selected video processors
selProcs.Add(allProcs(nIndex))
' get the count again
Dim m AsInteger = selProcs.Count
' set the result to what we expect
_result = (m > n AndAlso n = 0)
Catch e1 As Exception
_result = FalseEndTryEnd Sub
using Leadtools;
using Leadtools.MediaFoundation;
using LeadtoolsMediaFoundationExamples.Fixtures;
publicbool _result = false;
public PlayCtrlForm _form = new PlayCtrlForm();
publicvoid SelectProcessorsExample()
{
// reference the play control
PlayCtrl playctrl = _form.PlayCtrl;
try
{
// get the available video processors
VideoProcessors allProcs = playctrl.VideoProcessors;
// get the available video processors
VideoProcessors selProcs = playctrl.SelectedVideoProcessors;
// get the count of selected video processors
int n = selProcs.Count;
// get index of lead video Stabilizer transform
int nIndex = allProcs.IndexOf("{E2B6EDDE-38C5-11D5-91F6-00104BDB8FF9}");
// add the lead video Stabilizer transform to the selected video processors
selProcs.Add(allProcs[nIndex]);
// remove lead video Stabilizer transform from the selected video processors
selProcs.Remove(allProcs[nIndex]);
// get the count again
int m = selProcs.Count;
// set the result to what we expect
_result = (n == m);
}
catch (Exception)
{
_result = false;
}
}