加载/保存方法作为辅助方法提供给用户。的BarcodeEngine,BarcodeReader而且BarcodeWriter不要在内部使用这些方法。
要将以前保存到XML文件中的数据加载到BarcodeReadOptions。负载(string文件名).
若要将数据保存并加载到XML流,请使用BarcodeReadOptions。保存(流流)而且BarcodeReadOptions。负载(流流).
保存所使用的默认读选项BarcodeReader,使用BarcodeReader。其
这个示例创建线性1D条形码读取选项类,将其保存到磁盘,然后将其加载回来。
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.Barcode;使用Leadtools.ImageProcessing;公共无效BarcodeReadOptions_LoadSaveExample (){字符串xmlFileName = Path.Combine(LEAD_VARS.ImagesDir,“MyOptions.xml”);//创建选项OneDBarcodeReadOptions option1 =新OneDBarcodeReadOptions ();//显示其值ShowOptions (“默认1”, options1);//改变一些值options1。搜索Direction = BarcodeSearchDirection.HorizontalAndVertical;options1。ReturnCheckDigit = BarcodeReturnCheckDigit.Default;options1。EnableErrorCheck =真正的;ShowOptions (“新方案1”, options1);//保存到磁盘options1.Save (xmlFileName);//创建新选项OneDBarcodeReadOptions options2 =新OneDBarcodeReadOptions ();//显示其值ShowOptions (“默认2”, options2);//加载之前保存的选项options2.Load (xmlFileName);//显示它的值,应该和"New Options 1"一样ShowOptions (“加载2”, options2);}私人静态无效ShowOptions (字符串信息,OneDBarcodeReadOptions选项){//在这个例子中,我们只显示一些选项Console.WriteLine(消息);控制台。WriteLine (" SearchDirection: {0}", options.SearchDirection);控制台。WriteLine (" ReturnCheckDigit: {0}", options.ReturnCheckDigit);控制台。WriteLine (" EnableErrorCheck: {0}", options.EnableErrorCheck);控制台。WriteLine ("----------------");}静态类LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;}
进口Leadtools进口Leadtools。编解码器进口Leadtools。条形码进口Leadtools。ImageProcessing公共子BarcodeReadOptions_LoadSaveExample ()昏暗的xmlFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“MyOptions.xml”)创建选项昏暗的options1作为新OneDBarcodeReadOptions ()展示它的价值ShowOptions (“默认1”options1)改变一些价值观options1。搜索Direction = BarcodeSearchDirection.HorizontalAndVerticaloptions1。ReturnCheckDigit = BarcodeReturnCheckDigit。默认的options1。EnableErrorCheck =真正的ShowOptions (“新方案1”options1)将其保存到磁盘options1.Save (xmlFileName)创建新选项昏暗的options2作为新OneDBarcodeReadOptions ()展示它的价值ShowOptions (“默认2”options2)'加载之前保存的选项options2.Load (xmlFileName)显示它的值,应该和New Options 1一样ShowOptions (“加载2”options2)结束子私人共享子ShowOptions (按值传递消息作为字符串,按值传递选项作为OneDBarcodeReadOptions)在这个例子中,我们只会展示一些选项Console.WriteLine(消息)控制台。WriteLine (" SearchDirection: {0}"options.SearchDirection)控制台。WriteLine (" ReturnCheckDigit: {0}"options.ReturnCheckDigit)控制台。WriteLine (" EnableErrorCheck: {0}"options.EnableErrorCheck)控制台。WriteLine ("----------------")结束子公共NotInheritable类LEAD_VARS公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”结束类
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗网络查看器net
188宝金博怎么下载
支持的平台上
.NET、Java、Android和iOS/macOS程序集
C API/ c++类库
HTML5 JavaScript库
您的邮件已发送给技术支持!应该有人联系!如果你的事情很紧急,请回来聊天。
聊天时间:
周一至周五,美国东部时间上午8:30至下午6:00
感谢您的反馈!
请再次填写表格,开始新的聊天。
所有代理目前都离线。
聊天时间:
星期一至星期五
美国东部时间上午8:30 -下午6点
如需与我们联系,请填写此表格,我们将通过电子邮件与您联系。
