与其他组件比较 A Comparison between IronBarcode and Leadtools Barcode Jordi Bardia 已更新:七月 28, 2025 Download IronBarcode NuGet 下载 DLL 下载 Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article 条形码是数据的机器可读视觉表示,最初通过不同长度和间距的平行线表示。 这些类型的条形码可以通过称为条形码阅读器的光学扫描仪扫描。 随着时间的推移,引入了二维条形码,它使用各种形状而不是线条,并可以通过配备相应软件的数码相机或移动设备读取。 在本文中,我们将比较两个流行的条形码库:Leadtools Barcode 和 IronBarcode。 这两个库都支持.NET框架,并有助于条形码图像的生成和识别。 Leadtools Barcode LEADTOOLS Barcode SDK 是一个综合工具包,可供开发人员检测、阅读和生成各种类型的 1D 和 2D 条形码。 它支持多种编程语言,如.NET Framework, .NET Core, Xamarin, UWP, C++ Class Library, C#, VB, Java等。LEADTOOLS 提供 SOAP 和 RESTful 网络服务来管理跨不同平台的条形码。 IronBarcode IronBarcode for .NET 提供一个简单的API,用于在.NET应用程序中读取和写入条形码和二维码。 它支持各种类型的条形码和QR标准,并提供图像预处理以提高读取速度和准确性。 专为.NET项目设计,它允许通过最少的代码快速集成。 创建一个新项目 在 Visual Studio 中,您可以创建一个新的 Console/WPF/Windows 窗体应用程序来使用这些库。 在设置项目后,继续集成您选择的库。 安装 IronBarcode 库 使用 IronBarcode 有几种方法可以下载和安装 IronBarcode: 通过 Visual Studio 或 Visual Studio 命令行 从 NuGet 或 IronBarcode 网站直接下载 例如,使用 Visual Studio 命令行,您可以输入以下命令: Install-Package BarCode 使用 Leadtools Barcode 类似地,Leadtools Barcode 可以通过类似的方法安装。 使用命令行安装命令: Install-Package Leadtools.Barcode 条形码生成 两个库都便于条形码生成。 以下是每个的示例: 使用 IronBarcode // Create a barcode and save it as an image format var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128); MyBarCode.AddAnnotationTextBelowBarcode("123456"); MyBarCode.SaveAsImage("MyBarCode.jpeg"); // Create a barcode and save it as an image format var MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128); MyBarCode.AddAnnotationTextBelowBarcode("123456"); MyBarCode.SaveAsImage("MyBarCode.jpeg"); ' Create a barcode and save it as an image format Dim MyBarCode = BarcodeWriter.CreateBarcode("123456", BarcodeEncoding.Code128) MyBarCode.AddAnnotationTextBelowBarcode("123456") MyBarCode.SaveAsImage("MyBarCode.jpeg") $vbLabelText $csharpLabel 上面的代码使用指定的参数生成条形码对象,并将其保存为图像。 使用 Leadtools Barcode // Create and save a barcode using Leadtools barcodeEngineInstance.Writer.CalculateBarcodeDataBounds( LeadRect.Empty, imageResolution, imageResolution, qrData, qrWriteOptions ); imageHeight = qrData.Bounds.Height; imageWidth = qrData.Bounds.Width; barcodeImage = new RasterImage( RasterMemoryFlags.Conventional, imageWidth, imageHeight, bitsPerPixel, RasterByteOrder.Rgb, RasterViewPerspective.TopLeft, palette, IntPtr.Zero, userDataLength ); FillCommand fillCmd = new FillCommand(RasterColor.White); fillCmd.Run(barcodeImage); barcodeEngineInstance.Writer.WriteBarcode( barcodeImage, qrData, qrWriteOptions ); codecs.Save( barcodeImage, barcodeOutputStream, RasterImageFormat.CcittGroup4, bitsPerPixel ); // Create and save a barcode using Leadtools barcodeEngineInstance.Writer.CalculateBarcodeDataBounds( LeadRect.Empty, imageResolution, imageResolution, qrData, qrWriteOptions ); imageHeight = qrData.Bounds.Height; imageWidth = qrData.Bounds.Width; barcodeImage = new RasterImage( RasterMemoryFlags.Conventional, imageWidth, imageHeight, bitsPerPixel, RasterByteOrder.Rgb, RasterViewPerspective.TopLeft, palette, IntPtr.Zero, userDataLength ); FillCommand fillCmd = new FillCommand(RasterColor.White); fillCmd.Run(barcodeImage); barcodeEngineInstance.Writer.WriteBarcode( barcodeImage, qrData, qrWriteOptions ); codecs.Save( barcodeImage, barcodeOutputStream, RasterImageFormat.CcittGroup4, bitsPerPixel ); ' Create and save a barcode using Leadtools barcodeEngineInstance.Writer.CalculateBarcodeDataBounds(LeadRect.Empty, imageResolution, imageResolution, qrData, qrWriteOptions) imageHeight = qrData.Bounds.Height imageWidth = qrData.Bounds.Width barcodeImage = New RasterImage(RasterMemoryFlags.Conventional, imageWidth, imageHeight, bitsPerPixel, RasterByteOrder.Rgb, RasterViewPerspective.TopLeft, palette, IntPtr.Zero, userDataLength) Dim fillCmd As New FillCommand(RasterColor.White) fillCmd.Run(barcodeImage) barcodeEngineInstance.Writer.WriteBarcode(barcodeImage, qrData, qrWriteOptions) codecs.Save(barcodeImage, barcodeOutputStream, RasterImageFormat.CcittGroup4, bitsPerPixel) $vbLabelText $csharpLabel 此代码段涉及生成条形码并将其保存为所需的图像格式。 识别条形码 两个库都支持跨多种图像格式的条形码识别。 使用 IronBarcode BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg"); if (QRResult != null) { Console.WriteLine(QRResult.Value); Console.WriteLine(QRResult.BarcodeType); } BarcodeResult QRResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg"); if (QRResult != null) { Console.WriteLine(QRResult.Value); Console.WriteLine(QRResult.BarcodeType); } Dim QRResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("MyBarCode.jpg") If QRResult IsNot Nothing Then Console.WriteLine(QRResult.Value) Console.WriteLine(QRResult.BarcodeType) End If $vbLabelText $csharpLabel 这是从图像中读取条形码并输出其值和类型。 使用 Leadtools Barcode using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg")) { foreach (BarCodeResult result in reader.ReadBarCodes()) { Console.WriteLine("Type: " + result.CodeType); Console.WriteLine("CodeText: " + result.CodeText); } } using (BarCodeReader reader = new BarCodeReader(@"MyBarCode.jpg")) { foreach (BarCodeResult result in reader.ReadBarCodes()) { Console.WriteLine("Type: " + result.CodeType); Console.WriteLine("CodeText: " + result.CodeText); } } Using reader As New BarCodeReader("MyBarCode.jpg") For Each result As BarCodeResult In reader.ReadBarCodes() Console.WriteLine("Type: " & result.CodeType) Console.WriteLine("CodeText: " & result.CodeText) Next result End Using $vbLabelText $csharpLabel 此示例使用BarCodeReader从图像文件中提取条形码数据。 授权和定价 开始使用 IronBarcode 是一个专为 .NET 框架设计的条码读取和写入库。 IronBarcode 提供从 Lite License 到 Unlimited License 等多种许可选项,价格取决于开发人员、位置和项目用途。 他们提供带有免费更新和支持的永久许可。 Leadtools Leadtools 提供几个包,基于用户要求定价。 他们的定价从每年$1,295起,针对单个开发人员许可。 结论 Leadtools Barcode 和 IronBarcode 都是用于条形码操作的强大库。 然而,IronBarcode 提供更快的处理速度,价格更实惠,并包括额外的功能,使其在读取静态图像和 PDF 时特别通用。 强烈建议利用免费试用以确定其是否适合您的需求。 轻松开始您的条形码扫描和创建之旅! [{i:(Leadtools Barcode 是其相应所有者的注册商标。 本站与 Leadtools Barcode 无关、未被其认可或赞助。 所有产品名称、徽标和品牌均为其各自所有者的财产。 比较仅供参考,反映的是撰写时的公开信息。] 常见问题解答 IronBarcode和Leadtools Barcode有什么区别? IronBarcode为.NET应用程序提供了简化的API,专注于速度和易于集成,而Leadtools Barcode则提供了多个编程语言和跨平台网络服务的综合工具包。 如何在Visual Studio中安装条码库? 要在Visual Studio中安装IronBarcode,请使用NuGet包管理器命令:PM> Install-Package Barcode。您也可以直接从NuGet画廊或IronBarcode的官方网站下载。 如何在C#中生成条码? 可以使用IronBarcode在C#中生成条码,通过创建BarcodeWriter对象,设置所需的条码类型和内容,并使用SaveAsImage方法将输出保存为图像。 IronBarcode有哪些许可选项? IronBarcode提供多种许可选项,包括Lite和Unlimited licenses。价格根据开发人员数量、项目类型和位置而有所不同,永久许可包括免费更新和支持。 Leadtools Barcode是否支持多种编程语言? 是的,Leadtools Barcode支持多种语言,包括.NET Framework、.NET Core、Xamarin、UWP、C++、C#、VB和Java,使其在各种开发环境中都具有多样性。 Leadtools Barcode许可证的起始价格是多少? Leadtools Barcode许可证的起始价格为每年$1295,适用于单一开发者许可。 如何使用IronBarcode读取条码? 要使用IronBarcode读取条码,请使用BarcodeReader.QuicklyReadOneBarcode方法从图像中提取条码数据及其类型。 为什么选择IronBarcode而不是Leadtools Barcode? IronBarcode被称赞为其更快的处理能力、可负担性及额外的静态图像和PDF读取功能,使其成为.NET项目的多功能和高效选择。 IronBarcode和Leadtools Barcode都支持2D条码吗? 是的,这两个库都支持1D和2D条码的生成和识别,为各种应用提供灵活性。 Jordi Bardia 立即与工程团队聊天 软件工程师 Jordi 最擅长 Python、C# 和 C++,当他不在 Iron Software 利用这些技能时,他就在游戏编程。分享产品测试、产品开发和研究的责任,Jordi 在持续的产品改进中增加了巨大的价值。多样的经验使他面临挑战并保持投入,他表示这是在 Iron Software 工作的最喜欢的方面之一。Jordi 在佛罗里达州迈阿密长大,并在佛罗里达大学学习计算机科学和统计学。 相关文章 已更新九月 25, 2025 How to Choose the Best Barcode Library in C# 在本指南中,我们将比较五个最广泛使用的 .NET 条形码库——IronBarcode、http://ZXing.Net、Aspose.BarCode、BarcodeLib 和 Dynamsoft Barcode Reader。 阅读更多 已更新七月 28, 2025 How to Scan Barcodes in ZXing For C# Developers The core image decoding library, JavaSE-specific client code, and the Android client Barcode Scanner are only a few of the modules that make up ZXing. Numerous more independent open-source projects are built upon it. 阅读更多 已更新八月 31, 2025 ZXing.org QR Code Library and IronBarcode: A Comprehensive Comparison ZXing是一个流行的开源库,用于生成和解码一维和二维条形码。 阅读更多 A Comparison between IronBarcode and Spire BarcodeA Comparison between IronBarcode an...
已更新九月 25, 2025 How to Choose the Best Barcode Library in C# 在本指南中,我们将比较五个最广泛使用的 .NET 条形码库——IronBarcode、http://ZXing.Net、Aspose.BarCode、BarcodeLib 和 Dynamsoft Barcode Reader。 阅读更多
已更新七月 28, 2025 How to Scan Barcodes in ZXing For C# Developers The core image decoding library, JavaSE-specific client code, and the Android client Barcode Scanner are only a few of the modules that make up ZXing. Numerous more independent open-source projects are built upon it. 阅读更多
已更新八月 31, 2025 ZXing.org QR Code Library and IronBarcode: A Comprehensive Comparison ZXing是一个流行的开源库,用于生成和解码一维和二维条形码。 阅读更多