public virtual void LoadSettingsFromFile(string sourceFile,CaptureSettings flags)
public:virtual void LoadSettingsFromFile(String^ sourceFile,CaptureSettings flags)
sourceFile
The file containing the saved settings to load.
flags
The settings flags specifying which settings to load.
This reconstructs the capture configuration based on the settings loaded from the specified file. See the CaptureSettings enumeration for settings options. The capture object settings can be saved to a file by calling SaveSettingsToFile. The capture object settings can be saved to a stream by calling SaveSettingsToStream. Settings saved to a stream can be loaded using LoadSettingsFromStream.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public CaptureCtrlForm _form = new CaptureCtrlForm();public CaptureCtrl _capturectrl;public string _streamSettings = Path.Combine(LEAD_VARS.MediaDir, "CaptureCtrl_ObjectSettingsExample_Stream.xml");public string _fileSettings = Path.Combine(LEAD_VARS.MediaDir, "CaptureCtrl_ObjectSettingsExample.xml");public void ObjectSettingsExample(){// reference the play control_capturectrl = _form.CaptureCtrl;// output filestring outFile = Path.Combine(LEAD_VARS.MediaDir, "CaptureCtrl_ObjectSettingsExample.avi");try{Processor pVideoDizzy = _capturectrl.VideoProcessors.EFXDizzy;// set a video processor_capturectrl.SelectedVideoProcessors.Add(pVideoDizzy);// save the settings to a fileif (SaveFileSettings()){// now clear the selected processors again_capturectrl.SelectedVideoProcessors.Clear();// check whether a 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 = _capturectrl.SelectedVideoProcessors.Contains(pVideoDizzy);}}// save the settings to a streamif (SaveStreamSettings()){// now clear the selected processors again_capturectrl.SelectedVideoProcessors.Clear();// check whether a 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 &= _capturectrl.SelectedVideoProcessors.Contains(pVideoDizzy);}}}catch (Exception){_result = false;}}private void LoadFileSettings(){_capturectrl.LoadSettingsFromFile(_fileSettings, CaptureSettings.Processors);}private bool SaveFileSettings(){// check whether we can save the processors settingsif (_capturectrl.CanSaveObjectSettings(CaptureSettings.Processors)){_capturectrl.SaveSettingsToFile(_fileSettings, CaptureSettings.Processors);return true;}return false;}private void LoadStreamSettings(){Stream settings = new StreamReader(_streamSettings).BaseStream;_capturectrl.LoadSettingsFromStream(settings, CaptureSettings.Processors);settings.Close();}private bool SaveStreamSettings(){// check whether we can save the processors settingsif (_capturectrl.CanSaveObjectSettings(CaptureSettings.Processors)){Stream settings = new StreamWriter(_streamSettings, false).BaseStream;_capturectrl.SaveSettingsToStream(settings, CaptureSettings.Processors);settings.Close();return true;}return false;}static class LEAD_VARS{public const string MediaDir = @"C:\LEADTOOLS23\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
