[SerializableAttribute ()]
公共类OneDBarcodeReadOptions:BarcodeReadOptions
< TypeConverterAttribute () >
< SerializableAttribute () >
公共类OneDBarcodeReadOptions
继承了BarcodeReadOptions
实现了System.ICloneable
@接口LTOneDBarcodeReadOptions: LTBarcodeReadOptions
公共类OneDBarcodeReadOptions扩展BarcodeReadOptions
[TypeConverterAttribute ()]
[SerializableAttribute ()]
公共ref类OneDBarcodeReadOptions:公共BarcodeReadOptions,System.ICloneable
的OneDBarcodeReadOptions类是用来控制选项当阅读标准1 d(线性)使用LEADTOOLS条形码。设置选项在两个方面:
的BarcodeReader类包含默认选项为每个条码符号(或一组常见的象征学)。这些选项可以检索使用BarcodeReader.GetDefaultOptions方法通过以下之一:
改变返回的成员OneDBarcodeReadOptions通过铸造的BarcodeReadOptions来OneDBarcodeReadOptions。
您还可以创建的实例OneDBarcodeReadOptions类和直接使用它BarcodeReader.ReadBarcode和BarcodeReader.ReadBarcodes方法接受一个数组作为输入参数的选项。
基地BarcodeReadOptions包含以下成员和特点:
除了功能和成员,OneDBarcodeReadOptions包含这些标准1 d(线性)条形码具体特点:
成员 | 描述 |
---|---|
SearchDirection | 时所使用的方向寻找条形码(水平、垂直或两个) |
EnableFastMode | 快条形码阅读(推荐)。适用于大多数条形码品质好或差 |
粒度 | 扫描行/列的数量时跳过阅读条形码 |
MinimumStringLength | 最小的字符串长度时使用搜索非固定长度的条形码。 |
MaximumStringLength | 的最大字符串长度时使用搜索非固定长度的条形码。 |
WhiteLinesNumber | 白色空间的最小数量的线上方和下方的条码符号。 |
EnableDoublePass | 使内部自动预处理的图像数据如果没有条形码被发现。 |
EnablePreprocessing | 使应用自动分割和深度自动预处理图像然后教会如果没有条形码的象征。 |
ReturnCheckDigit | 返回的错误校验位的条码数据 |
EnableErrorCheck | 可选检查字用于有效性检查当阅读条形码(如果支持的话)。 |
AvoidCorruptedBlocks | 避免损坏块当阅读条形码。 |
AllowPartialRead | 允许返回部分读取条形码。 |
ResizeSmall1D | 增强的酒吧小模块宽度符号。 |
Code11CheckDigitType | 检查数字类型时使用阅读代码11 (USD-8)条形码。 |
MSIModuloType | 检查数字类型时使用阅读MSI(脉宽调制)条形码。 |
Code39Extended | 允许解码扩展字符当阅读代码3 9符号。 |
CalculateBarWidthReduction | 允许计算栏宽度减少价值。 |
这个例子展示了如何使用OneDBarcodeReadOptions选择类从图像读取UPC条形码。
使用Leadtools;
使用Leadtools.Codecs;
使用Leadtools.Barcode;
使用Leadtools.ImageProcessing;
公共无效OneDBarcode_Example ()
{
字符串imageFileName = Path.Combine (LEAD_VARS.ImagesDir,“MyOneDBarcodes.tif”);
BarcodeEngine引擎=新BarcodeEngine ();
/ /创建图像编写条形码
int分辨率= 300;
使用(= RasterImage.Create (RasterImage形象(int)(8.5 *分辨率),(int)(11.0 *分辨率),1,分辨率,RasterColor.FromKnownColor (RasterKnownColor.White)))
{
/ /写一个POSTNET和条形码
WriteBarcode(引擎。作家,形象,BarcodeSymbology.UPCA,“01234567890”,新LeadRect (100、400、200));
WriteBarcode(引擎。作家,形象,BarcodeSymbology.Code128,“代码128”,新LeadRect (400、400、200));
WriteBarcode(引擎。作家,形象,BarcodeSymbology.Code11,“124578”,新LeadRect (700、400、200));
/ /保存图片
使用(RasterCodecs编解码器=新RasterCodecs ())
{
编解码器。保存(图像、imageFileName RasterImageFormat。CcittGroup4, 1);
}
}
/ /现在再次读取条形码
使用(RasterCodecs编解码器=新RasterCodecs ())
{
使用(RasterImage图像= codecs.Load (imageFileName))
{
/ /读取UPC-A条形码
ReadBarcodes(引擎。读者,形象,BarcodeSymbology.UPCA);
/ /读取代码128条形码
ReadBarcodes(引擎。读者,形象,BarcodeSymbology.Code128);
/ /读取代码11条形码
ReadBarcodes(引擎。读者,形象,BarcodeSymbology.Code11);
}
}
}
私人无效WriteBarcode (BarcodeWriter作家,RasterImage形象,BarcodeSymbology象征,字符串价值,LeadRect范围)
{
/ /创建条形码数据
BarcodeData条形码=新BarcodeData(符号、价值);
条形码。边界=界限;
/ /设置写入选项
OneDBarcodeWriteOptions选项=新OneDBarcodeWriteOptions ();
选项。TextPosition = BarcodeOutputTextPosition.Default;
选项。UseXModule =假;
选项。XModule = 30;
选项。EnableErrorCheck =假;
选项。SetGS1DatabarLinkageBit =假;
选项。WriteTruncatedGS1Databar =假;
选项。Code128TableEncoding = Code128BarcodeTableEncoding.Auto;
选项。Code11CheckDigitType = Code11BarcodeCheckDigitType.CDigit;
选项。MSIModuloType = MSIBarcodeModuloType.Modulo10;
/ /写它
Console.WriteLine (“写作{0}条形码数据:{1}”、符号值);
作家。WriteBarcode(图像、条形码、期权);
}
私人无效ReadBarcodes (BarcodeReader读者,RasterImage形象,BarcodeSymbology符号)
{
/ /设置阅读选项
OneDBarcodeReadOptions选项=新OneDBarcodeReadOptions ();
选项。搜索Direction = BarcodeSearchDirection.Horizontal;
选项。EnableFastMode =真正的;
选项。粒度= 9;
选项。MinimumStringLength = 3;
选项。MaximumStringLength = 0;
选项。WhiteLinesNumber = 3;
选项。ReturnCheckDigit = BarcodeReturnCheckDigit.Default;
选项。EnableErrorCheck =假;
选项。AvoidCorruptedBlocks =假;
选项。AllowPartialRead =假;
选项。Code11CheckDigitType = Code11BarcodeCheckDigitType.CDigit;
选项。MSIModuloType = MSIBarcodeModuloType.Modulo10;
Console.WriteLine (“阅读{0}条形码”、符号);
BarcodeData条形码=读者。LeadRect ReadBarcode(图片。空,符号学,选项);
如果(条形码! =零)
{
Console.WriteLine (“数据:{0},{1}”条形码。界限,barcode.Value);
}
其他的
{
Console.WriteLine (“没有找到”);
}
}
静态类LEAD_VARS
{
公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;
}
进口Leadtools
进口Leadtools.Codecs
进口Leadtools.Barcode
进口Leadtools.ImageProcessing
公共子OneDBarcode_Example ()
昏暗的imageFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“MyOneDBarcodes.tif”)
昏暗的引擎作为新BarcodeEngine ()
“创建图片写的条形码
昏暗的决议作为整数= 300
使用图像作为RasterImage = RasterImage.Create (CType(8.5 *分辨率,整数),CType(11.0 *分辨率,整数),1,分辨率,RasterColor.FromKnownColor (RasterKnownColor.White))
写一个POSTNET和行星条形码
WriteBarcode(引擎。作家,形象,BarcodeSymbology.UPCA,“01234567890”,新LeadRect (100、400、200))
WriteBarcode(引擎。作家,形象,BarcodeSymbology.Code128,“代码128”,新LeadRect (400、400、200))
WriteBarcode(引擎。作家,形象,BarcodeSymbology.Code11,“124578”,新LeadRect (700、400、200))
“保存图像
使用编解码器作为新RasterCodecs ()
编解码器。保存(图像、imageFileName RasterImageFormat。CcittGroup4, 1)
结束使用
结束使用
“现在再次读取条形码
使用编解码器作为新RasterCodecs ()
使用图像作为RasterImage = codecs.Load (imageFileName)
”UPC-A条码阅读
ReadBarcodes(引擎。读者,形象,BarcodeSymbology.UPCA)
“128条码阅读代码
ReadBarcodes(引擎。读者,形象,BarcodeSymbology.Code128)
“阅读代码11条形码
ReadBarcodes(引擎。读者,形象,BarcodeSymbology.Code11)
结束使用
结束使用
结束子
私人子WriteBarcode (按值传递作家作为BarcodeWriter,按值传递图像作为RasterImage,按值传递符号学作为BarcodeSymbology,按值传递价值作为字符串,按值传递界限作为LeadRect)
“创建条形码数据
昏暗的条形码作为新BarcodeData(符号值)
条形码。边界=边界
设置写入选项
昏暗的选项作为新OneDBarcodeWriteOptions ()
选项。TextPosition = BarcodeOutputTextPosition。默认的
选项。UseXModule =假
选项。XModule = 30
选项。EnableErrorCheck =假
选项。SetGS1DatabarLinkageBit =假
选项。WriteTruncatedGS1Databar =假
选项。Code128TableEncoding = Code128BarcodeTableEncoding。汽车
选项。Code11CheckDigitType = Code11BarcodeCheckDigitType.CDigit
选项。MSIModuloType = MSIBarcodeModuloType.Modulo10
“把它写
Console.WriteLine (“写作{0}条形码数据:{1}”、符号值)
作家。WriteBarcode(图像、条形码、期权)
结束子
私人子ReadBarcodes (按值传递读者作为BarcodeReader,按值传递图像作为RasterImage,按值传递符号学作为BarcodeSymbology)
“设置阅读选项
昏暗的选项作为新OneDBarcodeReadOptions ()
选项。搜索Direction = BarcodeSearchDirection.Horizontal
选项。EnableFastMode =真正的
选项。粒度= 9
选项。MinimumStringLength = 3
选项。MaximumStringLength = 0
选项。WhiteLinesNumber = 3
选项。ReturnCheckDigit = BarcodeReturnCheckDigit。默认的
选项。EnableErrorCheck =假
选项。AvoidCorruptedBlocks =假
选项。AllowPartialRead =假
选项。Code11CheckDigitType = Code11BarcodeCheckDigitType.CDigit
选项。MSIModuloType = MSIBarcodeModuloType.Modulo10
Console.WriteLine (“阅读{0}条形码”、符号)
昏暗的条形码作为BarcodeData =读者。LeadRect ReadBarcode(图片。空,符号学,选项)
如果不没有(条形码)然后
Console.WriteLine (“数据:{0},{1}”条形码。界限,barcode.Value)
其他的
Console.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
医疗Web查看器net
188宝金博怎么下载
支持的平台上
net, Java, Android和iOS / macOS组件
C / c++类库的API
HTML5 JavaScript库
你的邮件已经发送到支持!有人应该联系!如果你的问题是紧急请回到聊天。
聊天时间:
周一——周五,上午6点等
谢谢你的反馈!
请填写表单重新开始一个新的聊天。
所有代理目前离线。
聊天时间:
周一-周五
早上8:30 - 6点
联系我们请填写这张表格,我们将通过电子邮件联系你。