没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:黄竹雯|2018-11-27 15:20:37.000|阅读 381 次
概述:本系列教程会解答您在使用条形码生成控件TBarCode SDK产品时遇到的绝大部分疑惑。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
TBarCode SDK是一款可以在任意应用程序和打印机下生成和打印所有条码的条码软件组件。TBarCode SDK对于Microsoft® Office 用户以及软件开发者提供条码打印。使用此款条码软件组件您可以以完美效果生成和打印所有用于工业和商业条码符号。
VB .NET中的以下示例代码生成针对热敏打印机输出(分辨率如203 dpi)优化的条形码图像:
Dim bc As New TECIT.TBarCode.Barcode() bc.BarcodeType = TECIT.TBarCode.BarcodeType.EanUcc128 bc.Data = "1234567890123" ' set font size bc.Font = New System.Drawing.Font("Arial", 15, System.Drawing.FontStyle.Bold, GraphicsUnit.Point) bc.TextDistance = 1.1 bc.BearerBarType = TECIT.TBarCode.BearerBarType.TopAndBottom bc.BearerBarWidth = 2.4 ' adjust quiet zone in [Modules] (recommended for bitmaps) bc.QuietZoneUnit = TECIT.TBarCode.QuietZoneUnit.Modules bc.QuietZoneLeft = 12 bc.QuietZoneRight = 12 ' important: set printer resolution of thermal printer bc.Dpi = 203 ' 203 dpi --> Module Width = 0.5005 = 4 Pixel per Module Dim moduleWidth As New Single moduleWidth = 0.5004926 'need exact value here! bc.SizeMode = TECIT.TBarCode.SizeMode.CustomModuleWidth bc.ModuleWidth = moduleWidth + 0.001 bc.AdjustModuleWidthToPixelRaster = True Dim width As New Single Dim height As New Single ' size in [mm] width = bc.CalculateBarcodeWidth(Nothing) height = 35 ' convert size to [Pixels] width = width / (25.4 / bc.Dpi) height = height / (25.4 / bc.Dpi) ' adjust bitmap size Dim drawBitmapRect As New Rectangle(0, 0, width, height) bc.BoundingRectangle = drawBitmapRect ' output to file bc.Draw("barcode.bmp", TECIT.TBarCode.ImageType.Bmp)
C#ASP .NET中的以下示例代码生成具有恒定大小的PDF417图像:
//PDF417 Barcode barcode = new Barcode(); barcode.Data = strMyData; barcode.BarcodeType = BarcodeType.Pdf417; barcode.Pdf417.EncodingMode = PdfEncodingMode.Binary; // with dpi = 100 we get 1 Pixel = 0.254 mms barcode.Dpi = 100; // we should specify the number of horizontal data columns // this inhibits the symbol to change its horizontal size regardless of data barcode.Pdf417.NumberOfColumns = 16; // use a value, which fits to your available space !! // now calculate optimal bitmap size for the bar code barcode.SizeMode = SizeMode.FitToBoundingRectangle; Size optimalSize = barcode.CalculateOptimalBitmapSize(null, 1, 1); // we already could use this optimal Size for saving the image // barcode.BoundingRectangle = new Rectangle(0, 0, optimalSize.Width, optimalSize.Height); // barcode.Draw(filename, ImageType.Jpg); // but we want a constant bitmap size, // which fits exactly into your predefined space Size finalSize = new Size(350, 200); // final bitmap size in Pixel // so we have to add empty spaces around the symbol via adding a quiet zone barcode.QuietZoneUnit = QuietZoneUnit.Pixel; // calculate the required empty quiet zone we have to add if (finalSize.Width > optimalSize.Width) barcode.QuietZoneRight = finalSize.Width - optimalSize.Width; else // should not occur!! Reduce the Pdf417.NumberOfColumns finalSize.Width = optimalSize.Width; if (finalSize.Height > optimalSize.Height) barcode.QuietZoneBottom = finalSize.Height - optimalSize.Height; else // should not occur!! Increase final bitmap size finalSize.Height = optimalSize.Height; barcode.BoundingRectangle = new Rectangle(0, 0, finalSize.Width, finalSize.Height); barcode.Draw(filename, ImageType.Jpg);
选项1
将以下属性添加到TBarCode .NET Web Control。这将生成一个优化的符号,适合120 x 120像素矩阵。如果需要,请增加“宽度/高度”和“NumberOfColumns”属性。
<cc2:BarcodeControl id =“BarcodeControl1” Width =“120”Height =“120” Barcode-Dpi =“96” Barcode-SizeMode =“MinimalModuleWidth” Barcode-Pdf417-NumberOfColumns =“3” Barcode-MustFit =“True”ErrorHandling =“ShowMessage” Barcode-BarcodeType =“Pdf417”
选项#2
在页面加载事件中或设置条形码数据后,应用以下计算。此代码将使用1:3的宽高比为图形模块。
Barcode barcode = BarcodeControl1.Barcode; barcode.SizeMode = SizeMode.FitToBoundingRectangle; System.Drawing.Size optimalSize = barcode.CalculateOptimalBitmapSize(null, 1, 1); BarcodeControl1.Width = new Unit(optimalSize.Width, UnitType.Pixel); BarcodeControl1.Height = new Unit(optimalSize.Height, UnitType.Pixel); BarcodeControl1.Refresh();
ASP .NET中的以下示例代码生成Code 39图像:
//Code 39 Barcode barcode = new Barcode(); barcode.Data = "10030000007611107871900002199908"; barcode.BarcodeType = BarcodeType.Code39; // with dpi = 100 we get 1 Pixel = 0.254 mms barcode.Dpi = 100; // bar code size should adapt to bounding rectangle barcode.SizeMode = SizeMode.FitToBoundingRectangle; // set default size of symbol (define the default height) barcode.BoundingRectangle = new Rectangle(0, 0, 254, 100 /* = 1 inch */); // now calculate optimal bitmap size for the bar code Size optimalSize = barcode.CalculateOptimalBitmapSize(null, 1, 1); // update rectangle to optimized size barcode.BoundingRectangle = new Rectangle(0, 0, optimalSize.Width, optimalSize.Height); barcode.Draw(filename, ImageType.Jpg);
以下C#.NET示例代码向您展示了如何调整Data Matrix的设置:
Barcode barcode = new TECIT.TBarCode.Barcode(); barcode.BarcodeType = BarcodeType.DataMatrix; barcode.DataMatrix.Size = DataMatrixSize.Square26x26; barcode.DataMatrix.Format = DataMatrixFormat.Default; barcode.DataMatrix.ShallEnforceBinaryEncoding = true; barcode.SizeMode = SizeMode.CustomModuleWidth; barcode.ModuleWidth = 0.423; barcode.EncodingMode = EncodingMode.Hexadecimal; // set preformatted data (Bytes = Hex codes) barcode.Data = "444541080D02540BE3FF0052232D242D000065000000010100015A313031000000000000000000000000";
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@wqylolg.cn
无论是零售、物流还是医疗保健,旋转条形码图像的功能都能增强不同应用的灵活性和适应性。使用Aspose.BarCode for Java,您可以轻松旋转条形码图像,确保它们无缝融入应用程序的设计和布局。
借助Aspose.Slides for Java,开发人员可以轻松编辑 PowerPoint 幻灯片(包括表格),以增强演示文稿的效果。
VMProtect 是保护程序代码免遭分析与破解的利器,但很多开发者在实现注册机制时犯了关键性错误,使得再强大的加壳工具也难以阻挡黑客破解。本文将从注册逻辑设计、密钥验证方式、注册状态存储等多个角度,系统拆解常见误区,并结合 VMProtect 的虚拟化和加密策略,提供构建高强度注册保护的实战方案。
在本文中,我们将探讨如何在FastReport .NET中配置与 Apache Ignite 的连接。您将学习通过代码和报表设计器连接插件的必要步骤。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@wqylolg.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢