public:String^ SaveProfile(WMProfile^ Profile)
Profile
A WMProfile object containing the profile data to be saved.
XML-formatted string containing the profile information.
Saves a profile to a string buffer, in the form of an XML-formatted string. The returned string should not be modified directly. To change the profile settings, load the saved profile using the WMProfileManager.LoadProfileByData method and change the settings using the WMProfile object methods. If you save the string in a file for later use, the file must have a "prx" extension. For more information, refer to the Microsoft documentation for IWMProfileManager.SaveProfile.
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:\LEADTOOLS22\Media";}
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
