Loads the system profile at the specified index.
public WMProfile LoadSystemProfile(int ProfileIndex)
Public Function LoadSystemProfile( _ByVal ProfileIndex As Integer _) As WMProfile
public:WMProfile^ LoadSystemProfile(int ProfileIndex)
ProfileIndex
Index of the system profile to load.
A WMProfile
Loads the system profile at the specified index. For more information, refer to the Microsoft documentation for IWMProfileManager.LoadSystemProfile.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public ConvertCtrlForm _form = new ConvertCtrlForm();public TestCtrlSubForm _subform = new TestCtrlSubForm();// this demo for enumerates system profiles and displays profile infopublic void SaveProfileExample(){ConvertCtrl convertctrl = _form.ConvertCtrl;string inFile = Path.Combine(LEAD_VARS.MediaDir, "ConvertCtrl_Source.avi");try{// create the profile managerWMProfileManager manager = new WMProfileManager();// build a list of system profilesBuildSystemProfileList(_subform.List);// show the dialog_subform.ShowDialog(_form);int idx = _subform.List.SelectedIndex;// load the selected profileWMProfile profile = LoadSystemProfile(manager, idx);// convert to stringstring sprof = ProfileToString(manager, profile);// display the stringif (profile.Version == WMT_Version.V8){MessageBox.Show("Profile "+ profile.Name+ " Content: "+ sprof+ "This profile contains "+ profile.StreamCount.ToString()+ " streams and "+ profile.MutualExclusionCount.ToString()+ " mutex");}// convert string to profileprofile = ProfileFromString(manager, sprof);// dispose the managermanager.Dispose();// set the result_result = true;}catch (Exception){_result = false;}// we'll loop on the state and pump messages for this example.// but you should not need to if running from a Windows Forms application.while (convertctrl.State == ConvertState.Running)Application.DoEvents();}private void BuildSystemProfileList(ListBox lbSysProfiles){// create the profile managerWMProfileManager manager = new WMProfileManager();WMProfile profile;// set the version to show Windows Media 8.0 system profilesmanager.SystemProfileVersion = WMT_Version.V8;// walk the list of system profiles and add the name to the combo boxlbSysProfiles.Items.Clear();// enumerate the system profilesfor (int i = 0; i < manager.SystemProfileCount - 1; i++){profile = manager.LoadSystemProfile(i);lbSysProfiles.Items.Add(profile.Name);}}private WMProfile LoadSystemProfile(WMProfileManager manager, int idx){// set the version to load Windows Media 8.0 system profilesmanager.SystemProfileVersion = WMT_Version.V8;// load the specified profilereturn manager.LoadSystemProfile(idx);}private string ProfileToString(WMProfileManager manager, WMProfile profile){// convert the profile to stringreturn manager.SaveProfile(profile);}private WMProfile ProfileFromString(WMProfileManager manager, string profilestr){// load profile from string datareturn manager.LoadProfileByData(profilestr);}static class LEAD_VARS{public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media";}
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _result As Boolean = FalsePublic _form As ConvertCtrlForm = New ConvertCtrlForm()Public _subform As TestCtrlSubForm = New TestCtrlSubForm()' this demo for enumerates system profiles and displays profile infoPublic Sub SaveProfileExample()Dim convertctrl As ConvertCtrl = _form.ConvertCtrlDim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "ConvertCtrl_Source.avi")Try' create the profile managerDim manager As WMProfileManager = New WMProfileManager()' build a list of system profilesBuildSystemProfileList(_subform.List)' show the dialog_subform.ShowDialog(_form)Dim idx As Integer = _subform.List.SelectedIndex' load the selected profileDim profile As WMProfile = LoadSystemProfile(manager, idx)' convert to stringDim sprof As String = ProfileToString(manager, profile)' display the stringIf profile.Version = WMT_Version.V8 ThenMessageBox.Show("Profile " _& profile.Name _& " Content: " _& sprof _& "This profile contains " _& profile.StreamCount.ToString() _& " streams and " _& profile.MutualExclusionCount.ToString() _& " mutex")End If' convert string to profileprofile = ProfileFromString(manager, sprof)' dispose the managermanager.Dispose()' set the result_result = TrueCatch e1 As Exception_result = FalseEnd Try' we'll loop on the state and pump messages for this example.' but you should not need to if running from a Windows Forms application.Do While convertctrl.State = ConvertState.RunningApplication.DoEvents()LoopEnd SubPrivate Sub BuildSystemProfileList(ByVal lbSysProfiles As ListBox)' create the profile managerDim manager As WMProfileManager = New WMProfileManager()Dim profile As WMProfile' set the version to show Windows Media 8.0 system profilesmanager.SystemProfileVersion = WMT_Version.V8' walk the list of system profiles and add the name to the combo boxlbSysProfiles.Items.Clear()' enumerate the system profilesDim i As Integer = 0Do While i < manager.SystemProfileCount - 1profile = manager.LoadSystemProfile(i)lbSysProfiles.Items.Add(profile.Name)i += 1LoopEnd SubPrivate Function LoadSystemProfile(ByVal manager As WMProfileManager, ByVal idx As Integer) As WMProfile' set the version to load Windows Media 8.0 system profilesmanager.SystemProfileVersion = WMT_Version.V8' load the specified profileReturn manager.LoadSystemProfile(idx)End FunctionPrivate Function ProfileToString(ByVal manager As WMProfileManager, ByVal profile As WMProfile) As String' convert the profile to stringReturn manager.SaveProfile(profile)End FunctionPrivate Function ProfileFromString(ByVal manager As WMProfileManager, ByVal profilestr As String) As WMProfile' load profile from string dataReturn manager.LoadProfileByData(profilestr)End FunctionPublic NotInheritable Class LEAD_VARSPublic Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media"End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
