Saves a profile to a string buffer, in the form of an XML-formatted string.
public string SaveProfile(Leadtools.Multimedia.WMProfile Profile)
Public Function SaveProfile( _ByVal Profile As Leadtools.Multimedia.WMProfile _) As String
public:String^ SaveProfile(Leadtools.Multimedia.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 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 19\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 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 19\Media"End Class
|
Products |
Support |
Feedback: SaveProfile Method - Leadtools.Multimedia |
Introduction |
Help Version 19.0.2017.6.16
|

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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.