public void Load(string fileName)
public:void Load(String^ fileName)
def Load(self,fileName):
fileName
The XML file containing the data.
The load/save methods are provided as helper methods for the user. The BarcodeEngine, BarcodeReader and BarcodeWriter do not use these methods internally.
To save a BarcodeReadOptions to an XML file, use BarcodeReadOptions.Save(string fileName).
To save and load data to an XML stream, use BarcodeReadOptions.Save(Stream stream) and BarcodeReadOptions.Load(Stream stream).
using Leadtools;using Leadtools.Codecs;using Leadtools.Barcode;using Leadtools.ImageProcessing;public void BarcodeReadOptions_LoadSaveExample(){string xmlFileName = Path.Combine(LEAD_VARS.ImagesDir, "MyOptions.xml");// Create the optionsOneDBarcodeReadOptions options1 = new OneDBarcodeReadOptions();// Show its valuesShowOptions("Default 1", options1);// Change some of the valuesoptions1.SearchDirection = BarcodeSearchDirection.HorizontalAndVertical;options1.ReturnCheckDigit = BarcodeReturnCheckDigit.Default;options1.EnableErrorCheck = true;ShowOptions("New Options 1", options1);// Save it to diskoptions1.Save(xmlFileName);// Create new optionsOneDBarcodeReadOptions options2 = new OneDBarcodeReadOptions();// Show its valuesShowOptions("Default 2", options2);// Load the previously saved optionsoptions2.Load(xmlFileName);// Show its values, should be the same as "New Options 1"ShowOptions("Loaded 2", options2);}private static void ShowOptions(string message, OneDBarcodeReadOptions options){// We will only show some of the options in this exampleConsole.WriteLine(message);Console.WriteLine(" SearchDirection: {0}", options.SearchDirection);Console.WriteLine(" ReturnCheckDigit: {0}", options.ReturnCheckDigit);Console.WriteLine(" EnableErrorCheck: {0}", options.EnableErrorCheck);Console.WriteLine("----------------");}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";}
import java.io.File;import java.io.IOException;import javax.sound.sampled.AudioFileFormat.Type;import org.junit.*;import org.junit.runner.JUnitCore;import org.junit.runner.Result;import org.junit.runner.notification.Failure;import static org.junit.Assert.*;import leadtools.*;import leadtools.barcode.*;import leadtools.codecs.*;import leadtools.imageprocessing.*;// // public void barcodeReadOptionsSaveExample() {// final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS22\\Resources\\Images";// String xmlFileName = combine(LEAD_VARS_IMAGES_DIR, "MyOptions.xml");// // Create the options// OneDBarcodeReadOptions options1 = new OneDBarcodeReadOptions();// // Show its values// ShowOptions("Default 1", options1);// // Change some of the values// options1.setSearchDirection(BarcodeSearchDirection.HORIZONTAL_AND_VERTICAL);// options1.setReturnCheckDigit(BarcodeReturnCheckDigit.DEFAULT);// options1.setEnableErrorCheck(true);// ShowOptions("New Options 1", options1);// // Save it to disk// options1.save(xmlFileName);// // Create new options// OneDBarcodeReadOptions options2 = new OneDBarcodeReadOptions();// // Show its values// ShowOptions("Default 2", options2);// // Load the previously saved options// options2.load(xmlFileName);// // Show its values, should be the same as "New Options 1"// ShowOptions("Loaded 2", options2);// }// private static void ShowOptions(String message, OneDBarcodeReadOptions// options) {// // We will only show some of the options in this example// System.out.println(message);// System.out.printf(" SearchDirection: {%s}", options.getSearchDirection());// System.out.printf(" ReturnCheckDigit: {%s}", options.getReturnCheckDigit());// System.out.printf(" EnableErrorCheck: {%s}", options.getEnableErrorCheck());// System.out.println("----------------");// }
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
