publicvirtualvoidLoadSettingsFromFile(stringsourceFile,ConvertSettingsflags)
PublicOverridableSubLoadSettingsFromFile( _ByValsourceFileAsString, _ByValflagsAsConvertSettings_)
public:virtualvoidLoadSettingsFromFile(String^sourceFile,ConvertSettingsflags)
sourceFile
The file from which settings will be loaded.
flags
The setting flags specifying which settings to load. See theConvertSettingsenumeration for the setting options.
Loads some or all of the convert object settings from a file. This reconstructs the conversion configuration using the settings found in the file. The convert object settings can be saved to a file by calling theSaveSettingsToFilemethod. Settings can be saved to a stream by calling theSaveSettingsToStreammethod. Settings saved to a stream can be loaded using theLoadSettingsFromStreammethod. It may be helpful to call theCanSaveObjectSettingsmethod before calling the save methods. This ensures the settings can be saved. If eitherSaveSettingsToFileorSaveSettingsToStreamis called for settings that cannot be saved, the save method will fail.
usingLeadtools;usingLeadtools.Multimedia;usingLeadtoolsMultimediaExamples.Fixtures;publicbool_result =false;publicConvertCtrlForm _form =newConvertCtrlForm();publicConvertCtrl _convertctrl;publicstring_streamSettings = Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_ObjectSettingsExample_Stream.xml");publicstring_fileSettings = Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_ObjectSettingsExample.xml");publicvoidObjectSettingsExample(){// reference the play control_convertctrl = _form.ConvertCtrl;// input and output filesstringinFile = Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_Source.avi");stringoutFile = Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_ObjectSettingsExample.avi");try{Processor pVideoDizzy = _convertctrl.VideoProcessors.EFXDizzy;// set a video processor_convertctrl.SelectedVideoProcessors.Add(pVideoDizzy);// save the settings to a fileif(SaveFileSettings()){// now clear the selected processors again_convertctrl.SelectedVideoProcessors.Clear();// check whether stream file existsif(File.Exists(_fileSettings)){// load the saved settings from a file// and check whether the processor is selected againLoadFileSettings();// set the result_result = _convertctrl.SelectedVideoProcessors.Contains(pVideoDizzy);}}// save the settings to a streamif(SaveStreamSettings()){// now clear the selected processors again_convertctrl.SelectedVideoProcessors.Clear();// check whether the stream file existsif(File.Exists(_streamSettings)){// load the saved settings from a stream// and check whether the processor is selected againLoadStreamSettings();// set the result_result & = _convertctrl。希利ctedVideoProcessors.Contains(pVideoDizzy);}}}catch(Exception){_result =false;}}privatevoidLoadFileSettings(){_convertctrl.LoadSettingsFromFile(_fileSettings, ConvertSettings.Processors);}privateboolSaveFileSettings(){// check whether we can save the processors settingsif(_convertctrl.CanSaveObjectSettings(ConvertSettings.Processors)){_convertctrl.SaveSettingsToFile(_fileSettings, ConvertSettings.Processors);returntrue;}returnfalse;}privatevoidLoadStreamSettings(){Stream settings =newStreamReader(_streamSettings).BaseStream;_convertctrl.LoadSettingsFromStream(settings, ConvertSettings.Processors);settings.Close();}privateboolSaveStreamSettings(){// check whether we can save the processors settingsif(_convertctrl.CanSaveObjectSettings(ConvertSettings.Processors)){Stream settings =newStreamWriter(_streamSettings,false).BaseStream;_convertctrl.SaveSettingsToStream(settings, ConvertSettings.Processors);settings.Close();returntrue;}returnfalse;}staticclassLEAD_VARS{publicconststringMediaDir =@"C:\LEADTOOLS21\Media";}
ImportsLeadtoolsImportsLeadtools.MultimediaImportsLeadtoolsMultimediaExamples.FixturesPublic_resultAsBoolean=FalsePublic_formAsConvertCtrlForm =NewConvertCtrlForm()Public_convertctrlAsConvertCtrlPublic_streamSettingsAsString= Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_ObjectSettingsExample_Stream.xml")Public_fileSettingsAsString= Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_ObjectSettingsExample.xml")PublicSubObjectSettingsExample()' reference the play control_convertctrl = _form.ConvertCtrl' input and output filesDiminFileAsString= Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_Source.avi")DimoutFileAsString= Path.Combine(LEAD_VARS.MediaDir,"ConvertCtrl_ObjectSettingsExample.avi")TryDimpVideoDizzyAsProcessor = _convertctrl.VideoProcessors.EFXDizzy' set a video processor_convertctrl.SelectedVideoProcessors.Add(pVideoDizzy)' save the settings to a fileIfSaveFileSettings()Then' now clear the selected processors again_convertctrl.SelectedVideoProcessors.Clear()' check if a stream file existsIfFile.Exists(_fileSettings)Then' load the saved settings from a file' and check if the processor is selected againLoadFileSettings()' set the result_result = _convertctrl.SelectedVideoProcessors.Contains(pVideoDizzy)EndIfEndIf' save the settings to a streamIfSaveStreamSettings()Then' now clear the selected processors again_convertctrl.SelectedVideoProcessors.Clear()' check if a stream file existsIfFile.Exists(_streamSettings)Then' load the saved settings from a stream' and check if the processor is selected againLoadStreamSettings()' set the result_result = _resultAnd_convertctrl.SelectedVideoProcessors.Contains(pVideoDizzy)EndIfEndIfCatche1AsException_result =FalseEndTryEndSubPrivateSubLoadFileSettings()_convertctrl.LoadSettingsFromFile(_fileSettings, ConvertSettings.Processors)EndSubPrivateFunctionSaveFileSettings()AsBoolean' check if we can save the processor's settingsIf_convertctrl.CanSaveObjectSettings(ConvertSettings.Processors)Then_convertctrl.SaveSettingsToFile(_fileSettings, ConvertSettings.Processors)ReturnTrueEndIfReturnFalseEndFunctionPrivateSubLoadStreamSettings()DimsettingsAsStream =NewStreamReader(_streamSettings).BaseStream_convertctrl.LoadSettingsFromStream(settings, ConvertSettings.Processors)settings.Close()EndSubPrivateFunctionSaveStreamSettings()AsBoolean' check if we can save the processors settingsIf_convertctrl.CanSaveObjectSettings(ConvertSettings.Processors)ThenDimsettingsAsStream =NewStreamWriter(_streamSettings,False).BaseStream_convertctrl.SaveSettingsToStream(settings, ConvertSettings.Processors)settings.Close()ReturnTrueEndIfReturnFalseEndFunctionPublicNotInheritableClassLEAD_VARSPublicConstMediaDirAsString="C:\LEADTOOLS21\Media"EndClass
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
188宝金博怎么下载
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
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.
