他のコンポーネントと比較

IronBarcodeとZXing.NETの比較

更新済み 12月 12, 2022
共有:

バーコードスキャナーが私たちのアプリケーションに常に適しているとは限りません。 あなたはすでにバーコードのデジタル画像をお持ちで、そのバーコードが英語のテキストで何を表しているのかを知りたいかもしれません。 さらに、このスキャナーは1次元バーコードしか読み取れず、データ量が限られており、Windows RT クラスライブラリでのみ使用できます。 2次元バーコード (QRコードとしても知られる) 一般的になり、より多くの情報を保持できるようになりました。

C#ベースのアプリケーションは、シンプルなAPIコールといくつかのコーディングステップを使用してバーコードを読み取るために作成できます。 .NET対応のアプリケーションは、サードパーティのツールやAPIに依存せずに、Windows、macOS、またはLinux上で動作します。

この記事では、プログラムによってバーコードを読み取るための最も強力な2つの.NET Coreアプリライブラリを比較します。 これらの2つのライブラリはIronBarcodeとZXing.NETです。 IronBarcodeがZXing.NETよりも強力で堅牢である理由を見ていきます。


ZXing.NETとは

ZXing.NETはバーコードをデコードおよび生成するライブラリです。 (QRコード、PDF 417、EAN、UPC、Aztec、Data Matrix、Codabar). ZXing(「zebra crossing」の略)は、さまざまな1Dおよび2Dバーコード形式をサポートするJavaベースのオープンソースライブラリです。

その主要な特徴は次の通りです:

  • URL、連絡先情報、カレンダーイベントなどを保存する機能を備えています。
  • それはJava SEアプリケーションに合わせて調整されています。
  • インテントを介してバーコードスキャナーの統合を可能にします
  • これは簡単なGoogle Glassアプリです。

IronBarcodeとは

IronBarcodeは、プログラマーがバーコードを読み取りおよび生成することを可能にするC#ライブラリです。 業界をリードするバーコードライブラリとして、IronBarcodeは装飾された1次元および2次元バーコードを含む幅広いバーコードをサポートしています。 (カラーおよびブランド化された) QRコード。 .NET StandardおよびCoreバージョン2以降をサポートしており、Azure、Linux、macOS、Windows、およびWeb上でクロスプラットフォームで使用できます。 IronBarcodeは、標準化されたプログラミング言語で作業できるように、C#、VB.NET、F#の開発者向けに提供される.NETシステム用の有名なクラスライブラリまたはコンポーネントです。 お客様がスキャナータグを閲覧し、新しい標準化されたラベルを作成できるようになります。 それは、2Dバーコードや他の3D標準化バーコードと非常にうまく機能します。

IronBarcodeは現在、2Dバーコードをサポートしています。 印刷や広告資料で使用するために、これらのコードの色彩、スタイリング、およびピクセル化を最適化する機能を提供し、ロゴを追加することもできます。 このライブラリは、他のバーコードソフトウェアでは読み取れないかもしれない歪んだり変形したりしたバーコードも読み取ることができます。

IronBarcodeとZXing.NETのインストール

ZXing.NETのインストール

ZXing.NETライブラリを使用するには、NuGetパッケージマネージャーコンソールを使用して以下の2つのパッケージをASP.NET Coreアプリケーションにインストールしてください。

1. ZXing.Net (ゼットシング・ネット)

Install-Package ZXing.Net

2. ZXing.Net.Bindings.CoreCompat.System.Drawing

ZXing.Net.Bindings.CoreCompat.System.Drawing

Install-Package ZXing.Net.Bindings.CoreCompat.System.Drawing -Version 0.16.5-beta

または、NuGetパッケージマネージャーを使用してプロジェクトにZXing.NETをインストールします。 以下の操作を行ってください:Tools > NuGet Package Manager > Manage NuGet packages for solutions...に移動し、"Browse"タブに切り替えて"ZXing.NET"を検索します。

A Comparison between IronBarcode and Zxing.NET, Figure 1: ASP.NET ウェブアプリケーション

ASP.NET ウェブアプリケーション

IronBarcodeのインストール

IronBarcodeをインストールするには、NuGetパッケージマネージャーを使用するか、DLLを直接ダウンロードしてください。 製品ウェブサイト. について IronBarcode 名前空間にはすべてのIronBarcodeクラスが含まれています。

IronBarcodeは、Visual StudioのNuGetパッケージマネージャーを使用してインストールできます。パッケージ名は「Barcode」です。

Install-Package BarCode

2Dバーコードの作成

ZXing.NETの使用

まず、プロジェクトファイルのルートフォルダー内に「qrr」という新しいフォルダーを作成します。

次に、QRファイルを作成し、画像システムファイルを'qrr'フォルダ内に保存します。

コントローラー内で、GenerateFile を追加します。()以下のソースコードに示されている ` メソッドを使用します。

public ActionResult GenerateFile()
{
    return View();
}

[HttpPost]
public ActionResult GenerateFile(string qrText)
{
    Byte [] byteArray;
    var width = 250; // width of the QR Code
    var height = 250; // height of the QR Code
    var margin = 0;
    var qrCodeWriter = new ZXing.BarcodeWriterPixelData
    {
        Format = ZXing.BarcodeFormat.QR_CODE,
        Options = new QrCodeEncodingOptions
        {
            Height = height,
            Width = width,
            Margin = margin
        }
    };
    var pixelData = qrCodeWriter.Write(qrText);

    // creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
    using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
    {
        using (var ms = new MemoryStream())
        {
            var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
            try
            {
                // we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
                System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan, pixelData.Pixels.Length);
            }
            finally
            {
                bitmap.UnlockBits(bitmapData);
            }

            // save to folder
            string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
            bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);

            // save to stream as PNG
            bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            byteArray = ms.ToArray();
        }
    }
    return View(byteArray);
}
public ActionResult GenerateFile()
{
    return View();
}

[HttpPost]
public ActionResult GenerateFile(string qrText)
{
    Byte [] byteArray;
    var width = 250; // width of the QR Code
    var height = 250; // height of the QR Code
    var margin = 0;
    var qrCodeWriter = new ZXing.BarcodeWriterPixelData
    {
        Format = ZXing.BarcodeFormat.QR_CODE,
        Options = new QrCodeEncodingOptions
        {
            Height = height,
            Width = width,
            Margin = margin
        }
    };
    var pixelData = qrCodeWriter.Write(qrText);

    // creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
    using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
    {
        using (var ms = new MemoryStream())
        {
            var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
            try
            {
                // we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
                System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan, pixelData.Pixels.Length);
            }
            finally
            {
                bitmap.UnlockBits(bitmapData);
            }

            // save to folder
            string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
            bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);

            // save to stream as PNG
            bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            byteArray = ms.ToArray();
        }
    }
    return View(byteArray);
}
Public Function GenerateFile() As ActionResult
	Return View()
End Function

<HttpPost>
Public Function GenerateFile(ByVal qrText As String) As ActionResult
	Dim byteArray() As Byte
	Dim width = 250 ' width of the QR Code
	Dim height = 250 ' height of the QR Code
	Dim margin = 0
	Dim qrCodeWriter = New ZXing.BarcodeWriterPixelData With {
		.Format = ZXing.BarcodeFormat.QR_CODE,
		.Options = New QrCodeEncodingOptions With {
			.Height = height,
			.Width = width,
			.Margin = margin
		}
	}
	Dim pixelData = qrCodeWriter.Write(qrText)

	' creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
	Using bitmap = New System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb)
		Using ms = New MemoryStream()
			Dim bitmapData = bitmap.LockBits(New System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb)
			Try
				' we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
				System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan, pixelData.Pixels.Length)
			Finally
				bitmap.UnlockBits(bitmapData)
			End Try

			' save to folder
			Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)
			bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)

			' save to stream as PNG
			bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
			byteArray = ms.ToArray()
		End Using
	End Using
	Return View(byteArray)
End Function
VB   C#

残っている唯一の変更は、QRコードファイルを 'qrr' フォルダー内に保存することです。 これは、以下の2行のコードを使用して実行されます。

string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)
bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)
VB   C#

GenerateFileビューも作成し、以下のコードを含める必要があります。 GenerateFile ビューは Index ビューと同一です。

@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
    <table>
        <tbody>
            <tr>
                <td>
                    <label>Enter text for creating QR Code</label>
                </td>
                <td>
// text box to enter text...
                    <input type="text" name="qrText" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button>Submit</button>
                </td>
            </tr>
        </tbody>
    </table>
}
@{
    if (Model != null)
    {
        <h3>QR Code Successfully Generated</h3>
// img tag to display generated QR code...
        <img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
    }
}
@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
    <table>
        <tbody>
            <tr>
                <td>
                    <label>Enter text for creating QR Code</label>
                </td>
                <td>
// text box to enter text...
                    <input type="text" name="qrText" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <button>Submit</button>
                </td>
            </tr>
        </tbody>
    </table>
}
@{
    if (Model != null)
    {
        <h3>QR Code Successfully Generated</h3>
// img tag to display generated QR code...
        <img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
    }
}
model Function [using](Html.BeginForm ByVal As (Nothing, Nothing, FormMethod.Post)) As Byte()
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan="2"> <button> Submit</button> </td> </tr> </tbody> </table>
	"qrText" /> </td> </tr> (Of tr) <td colspan="2"> (Of button) Submit</button> </td> </tr> </tbody> </table>
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan
	"text" name="qrText" /> </td> </tr> (Of tr) <td colspan
	(Of table) (Of tbody) (Of tr) (Of td) (Of label) Enter text for creating QR Code</label> </td> (Of td) <input type="text" name
End Function
@
If True Then
	If Model IsNot Nothing Then
'INSTANT VB WARNING: Instant VB cannot determine whether both operands of this division are integer types - if they are then you should use the VB integer division operator:
		(Of h3) QR Code Successfully Generated</h3> <img src="@String.Format("data:image/png
		base64,
		If True Then
			0
		End If
		", Convert.ToBase64String(Model))" />
	End If
End If
VB   C#

テキストボックスに任意の値を入力し、「送信」ボタンをクリックしてください。 QRコードは「qrr」フォルダに.PNGファイルとして生成され保存されます。

A Comparison between IronBarcode and ZXing.NET, Figure 2: QRコードジェネレーター

QRコードジェネレーター

A Comparison between IronBarcode and ZXing.NET, Figure 3: 表示されたQRコードファイル

表示されたQRコードファイル

サポートされるバーコード形式

IronBarcodeは、一般的に使用されるさまざまなバーコード形式をサポートしています、以下を含む:

  • ロゴと色が付いたQRコード(装飾されたコードおよびブランド化されたコードを含む)
  • マルチフォーマットバーコードには、Aztec、Data Matrix、CODE 93、CODE 128、RSS Expanded Databar、UPS MaxiCode、およびUSPS、IMBが含まれます。 (ワンコード (ワンコード (OneCode))) バーコード
  • RSS-14およびPDF-417スタック型線形バーコード
  • UPCA、UPCE、EAN-8、EAN-13、Codabar、ITF、MSI、Plesseyは従来の数値バーコードフォーマットです。

バーコードを作成して保存

var MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");
Image  MyBarCodeImage = MyBarCode.Image;
Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte [] PngBytes = MyBarCode.ToPngBinaryData();
     // Binary barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream()){
    // Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
var MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");
Image  MyBarCodeImage = MyBarCode.Image;
Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte [] PngBytes = MyBarCode.ToPngBinaryData();
     // Binary barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream()){
    // Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
Dim MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128)
MyBarCode.SaveAsImage("MyBarCode.png")
MyBarCode.SaveAsGif("MyBarCode.gif")
MyBarCode.SaveAsHtmlFile("MyBarCode.html")
MyBarCode.SaveAsJpeg("MyBarCode.jpg")
MyBarCode.SaveAsPdf("MyBarCode.Pdf")
MyBarCode.SaveAsPng("MyBarCode.png")
MyBarCode.SaveAsTiff("MyBarCode.tiff")
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp")
Dim MyBarCodeImage As Image = MyBarCode.Image
Dim MyBarCodeBitmap As Bitmap = MyBarCode.ToBitmap()
Dim DataURL As String = MyBarCode.ToDataUrl()
Dim ImgTagForHTML As String = MyBarCode.ToHtmlTag()
Dim PngBytes() As Byte = MyBarCode.ToPngBinaryData()
	 ' Binary barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
Using PdfStream As System.IO.Stream = MyBarCode.ToPdfStream()
	' Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
End Using
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50)
VB   C#

一方、ZXingはJavaベースのオープンソースの1D/2Dバーコード画像処理ライブラリです。 UPC-A、UPC-E、EAN-8、Code 93、Code 128、QRコード、Data Matrix、Aztec、PDF 417、およびその他のバーコード形式に対応しています。

A Comparison between IronBarcode and Zxing.NET, Figure 4: サポートされるバーコード形式

サポートされるバーコード形式

IronBarcodeを使用してQRコードファイルを作成する

IronBarcodeでQRコードを作成するには、BarcodeWriterクラスではなく、QRCodeWriterクラスを使用します。 このクラスは、QRコードを作成するための新しいそして興味深い機能を導入します。 QRのエラー訂正レベルを設定できるため、QRコードのサイズと読みやすさのバランスを取ることが可能です。

// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
' Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png")
VB   C#

エラー修正は、現実の状況でQRコードを読み取る容易さを指定することを可能にします。 エラー修正のレベルが高くなると、ピクセル数と複雑さが増した大きなQRコードになります。 以下の画像に、QRコードファイルが表示されています。

IronBarcodeとZXing.NETの比較、図5:対応するバーコードフォーマット

QRコード画像

最初に、IronBarcode.BarcodeWriterEncoding列挙型からバーコードの値とバーコードの形式を指定します。 次に、画像、System.Drawing.Image、またはBitmapコードオブジェクトとして保存できます。 これで必要なソースコードはすべてです。!

// Generate a simple BarCode image and save as PNG using following namespaces
using IronBarCode;
GeneratedBarcode MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");
// This line opens the image in your default image viewer
System.Diagnostics.Process.Start("MyBarCode.png");
// Generate a simple BarCode image and save as PNG using following namespaces
using IronBarCode;
GeneratedBarcode MyBarCode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");
// This line opens the image in your default image viewer
System.Diagnostics.Process.Start("MyBarCode.png");
' Generate a simple BarCode image and save as PNG using following namespaces
Imports IronBarCode
Private MyBarCode As GeneratedBarcode = IronBarcode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128)
MyBarCode.SaveAsPng("MyBarCode.png")
' This line opens the image in your default image viewer
System.Diagnostics.Process.Start("MyBarCode.png")
VB   C#
A Comparison between IronBarcode and ZXing.NET, Figure 6: C# でバーコード画像を作成する例

C# でバーコード画像を作成する例

IronBarcodeは、画像の正確な中央にロゴグラフィックを配置してグリッドにスナップさせるなど、QRコードのスタイリングにも対応しています。 それは特定のブランドやグラフィックアイデンティティに合わせて色付けすることもできます。

テストのために、以下のコードサンプルでロゴを作成し、『QRCodeWriter.CreateQRCodeWithLogo』メソッドを使用するのがいかに簡単かを確認してください。

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
' Adding a Logo
Dim MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
VB   C#
A Comparison between IronBarcode and ZXing.NET, Figure 7: ロゴ画像付きのQRコードを作成

ロゴ画像付きのQRコードを作成

最後に、生成されたQRコードをPDFファイルとして保存します。利便性のために、最終行のコードはQRコードをHTMLファイルとして保存します。

// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
//Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");
//Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
//Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");
//Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
' Adding a Logo
Dim MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
'Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf")
'Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html")
VB   C#

以下に、バーコードを作成、スタイル設定、エクスポートする方法を1行のコードで示します。

IronBarcodeには、System.Linqに類似した流暢なAPIが含まれています。 バーコードを生成し、そのマージンを設定し、メソッドの呼び出しをチェーンすることによってビットマップにエクスポートすることが一行でできます。 これは非常に有用であり、コードの読みやすさを向上させます。

using IronBarCode;
using System.Drawing;
 // Fluent API for Barcode image generation.
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417).ResizeTo(300,200).SetMargins(100).ToBitmap();
using IronBarCode;
using System.Drawing;
 // Fluent API for Barcode image generation.
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417).ResizeTo(300,200).SetMargins(100).ToBitmap();
Imports IronBarCode
Imports System.Drawing
 ' Fluent API for Barcode image generation.
Private MyValue As String = "https://ironsoftware.com/csharp/barcode"
Private BarcodeBmp As Bitmap = IronBarcode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417).ResizeTo(300,200).SetMargins(100).ToBitmap()
VB   C#

その結果、PDF417バーコードのSystem.Drawing.Imageが以下のように表示されます:

A Comparison between IronBarcode and ZXing.NET, Figure 8: C#でシンプルでスムーズなPDF417バーコード生成

C#でシンプルでスムーズなPDF417バーコード生成

QRコードファイルの読み取り

IronBarcodeを使用したQRコードの読み取り

バーコードまたはQRコードを読み取るのは、.NETバーコードリーダーと連携してIronBarcodeクラスライブラリを使用すると非常に簡単です。 最初の例では、わずか1行のコードでバーコードを読み取る方法を見ることができます。

A Comparison between IronBarcode and ZXing.NET, Figure 9: C#でスキャンするためのCode128バーコード画像

C#でスキャンするためのCode128バーコード画像

私たちは、バーコードの値、画像、エンコーディングタイプ、およびバイナリデータを取得できます。 (何かあれば) その後、コンソールに出力します。

using IronBarCode;
using System;
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result !=null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
  Console.WriteLine("GetStarted was a success.  Read Value: " + Result.Text);
}
using IronBarCode;
using System;
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result !=null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
  Console.WriteLine("GetStarted was a success.  Read Value: " + Result.Text);
}
Imports IronBarCode
Imports System
Private Result As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png")
If Result IsNot Nothing AndAlso Result.Text = "https://ironsoftware.com/csharp/barcode/" Then
  Console.WriteLine("GetStarted was a success.  Read Value: " & Result.Text)
End If
VB   C#

PDF内のバーコードの読み取り

スキャンされたPDFドキュメントを読み取り、数行のコードで全ての一次元バーコードを見つける方法を見ていきます。

ご覧のとおり、単一のドキュメントから単一のバーコードを読み取るのと非常に似ていますが、今回はバーコードがどのページにあるかもわかります。

using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image.  A PDF document may also be used as the input image
PagedBarcodeResult [] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
    string Value = PageResult.Value;
    int PageNum = PageResult.PageNumber;
    System.Drawing.Bitmap Img = PageResult.BarcodeImage;
    BarcodeEncoding BarcodeType = PageResult.BarcodeType;
    byte [] Binary = PageResult.BinaryValue;
    Console.WriteLine(PageResult.Value+" on page "+ PageNum);
}
using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image.  A PDF document may also be used as the input image
PagedBarcodeResult [] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
    string Value = PageResult.Value;
    int PageNum = PageResult.PageNumber;
    System.Drawing.Bitmap Img = PageResult.BarcodeImage;
    BarcodeEncoding BarcodeType = PageResult.BarcodeType;
    byte [] Binary = PageResult.BinaryValue;
    Console.WriteLine(PageResult.Value+" on page "+ PageNum);
}
Imports IronBarCode
Imports System
Imports System.Drawing
' Multiple barcodes may be scanned up from a single document or image.  A PDF document may also be used as the input image
Private PDFResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf")
' Work with the results
For Each PageResult In PDFResults
	Dim Value As String = PageResult.Value
	Dim PageNum As Integer = PageResult.PageNumber
	Dim Img As System.Drawing.Bitmap = PageResult.BarcodeImage
	Dim BarcodeType As BarcodeEncoding = PageResult.BarcodeType
	Dim Binary() As Byte = PageResult.BinaryValue
	Console.WriteLine(PageResult.Value &" on page " & PageNum)
Next PageResult
VB   C#

PDF内のすべてのビットマップバーコードを含む結果データを取得できます。

A Comparison between IronBarcode and ZXing.NET, Figure 10: PDF 内に保存されているバーコードの読み取り結果

PDF 内に保存されているバーコードの読み取り結果

GIFやTIFFからのバーコード読み取り

// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult [] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
//...
}
// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult [] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
//...
}
' Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
Dim MultiFrameResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels)
For Each PageResult In MultiFrameResults
'...
Next PageResult
VB   C#
A Comparison between IronBarcode and ZXing.NET, Figure 11: マルチフレームTIFF画像からバーコードを読み取る

マルチフレームTIFF画像からバーコードを読み取る

次の例は、スキャンしたPDFからQRコードとPDF-417バーコードを読み取る方法を示しています。 私たちは、必要以上に性能に悪影響を与えることなくドキュメントを軽く整えるために、適切なレベルのバーコード回転補正とバーコード画像補正を設定しました。

// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);
// Work with the results
foreach (var PageResult in ScanResults)
{
  string Value = PageResult.Value;
  ///...
}
// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);
// Work with the results
foreach (var PageResult in ScanResults)
{
  string Value = PageResult.Value;
  ///...
}
' PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
Dim ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels)
' Work with the results
For Each PageResult In ScanResults
  Dim Value As String = PageResult.Value
  '''...
Next PageResult
VB   C#
A Comparison between IronBarcode and ZXing.NET, Figure 12: スキャンされたPDFドキュメントからバーコードを読み取る

スキャンされたPDFドキュメントからバーコードを読み取る

ビットマップ画像から破損したQRコードを読み取る

以下の例は、このC#バコードライブラリが壊れたバーコードのサムネイルさえも読み取ることができることを示しています。

バーコードサムネイルサイズの修正は自動的に行われます。 IronBarcodeを使用すると、C#でファイルを読み取り可能にします。

読み取りメソッドは、正当なバーコードとしては小さすぎるバーコード画像を自動的に検出し、それらをアップスケールします。 それらはサムネイルと共に作業する際に関連するすべてのデジタルノイズを除去し、それらを再び読みやすくします。

// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
' Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
Dim SmallResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128)
VB   C#
A Comparison between IronBarcode and ZXing.NET, Figure 13: 自動バーコードサムネイルサイズ補正

自動バーコードサムネイルサイズ補正

不完全な画像からバーコードを読み取る

実際のシナリオでは、私たちは不完全な画像からバーコードを読み取ることがあるかもしれません。 それらは歪んだ画像やデジタルノイズを含む写真である可能性があります。ほとんどのオープンソースの.NETバーコード生成および読み取りライブラリでは、これは不可能でしょう。 一方、IronBarcodeは、不完全な画像からバーコードを読み取ることを容易にします。

次に、ReadASingleBarcode メソッドを見ていきます。 RotationCorrectionパラメーターを使用すると、IronBarcodeは不完全なデジタルサンプルからバーコードを補正し、読み取ろうとします。

using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
// * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
// * BarcodeEncoding      e.g. BarcodeEncoding.Code128,  Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte [] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);
using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
// * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
// * BarcodeEncoding      e.g. BarcodeEncoding.Code128,  Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte [] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);
Imports IronBarCode
Imports System
Imports System.Drawing
' All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
' * RotationCorrection   e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
' * ImageCorrection      e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
' * BarcodeEncoding      e.g. BarcodeEncoding.Code128,  Setting a specific Barcode format improves speed and reduces the risk of false positive results
' Example with a photo image
Private PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels)
Private Value As String = PhotoResult.Value
Private Img As System.Drawing.Bitmap = PhotoResult.BarcodeImage
Private BarcodeType As BarcodeEncoding = PhotoResult.BarcodeType
Private Binary() As Byte = PhotoResult.BinaryValue
Console.WriteLine(PhotoResult.Value)
VB   C#
A Comparison between IronBarcode and ZXing.NET, Figure 14: 携帯カメラからバーコードを読み取る

携帯カメラからバーコードを読み取る

IronBarcodeは複数のバーコードを同時に読み取ることもできます。複数のドキュメントのリストを作成し、バーコードリーダーを使用して多くのドキュメントを読み取ると、IronBarcodeからより良い結果を得ることができます。 バーコードスキャンプロセスのメソッド ReadBarcodesMultithreaded は、複数のスレッドおよび潜在的にCPUのすべてのコアを使用するため、1つずつバーコードを読み込むよりも指数関数的に速くなります。

// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs.  All threads are automatically managed by IronBarcode.
var ListOfDocuments = new [] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult [] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);
// Work with the results
foreach (var Result in BatchResults)
{
    string Value = Result.Value;
    //...
}
// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs.  All threads are automatically managed by IronBarcode.
var ListOfDocuments = new [] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult [] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);
// Work with the results
foreach (var Result in BatchResults)
{
    string Value = Result.Value;
    //...
}
' The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs.  All threads are automatically managed by IronBarcode.
Dim ListOfDocuments = { "Image1.png", "image2.JPG", "image3.pdf" }
Dim BatchResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments)
' Work with the results
For Each Result In BatchResults
	Dim Value As String = Result.Value
	'...
Next Result
VB   C#

ZXing.NETによるQRコードの読み取りとデコード

QRコードファイルを読み取るには、以下のようにコントローラーにViewFileアクションメソッドを追加します。

public ActionResult ViewFile()
{
    List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
    KeyValuePair<string, string> data;

    string [] files = Directory.GetFiles(Server.MapPath("~/qrr"));
    foreach (string file in files)
    {
        // create a barcode reader instance
        IBarcodeReader reader = new BarcodeReader();
        // load a bitmap
        var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));
        // detect and decode the barcode inside the bitmap
        var result = reader.Decode(barcodeBitmap);
        // do something with the result
        data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
        fileData.Add(data);
    }
    return View(fileData);
}
public ActionResult ViewFile()
{
    List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
    KeyValuePair<string, string> data;

    string [] files = Directory.GetFiles(Server.MapPath("~/qrr"));
    foreach (string file in files)
    {
        // create a barcode reader instance
        IBarcodeReader reader = new BarcodeReader();
        // load a bitmap
        var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));
        // detect and decode the barcode inside the bitmap
        var result = reader.Decode(barcodeBitmap);
        // do something with the result
        data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
        fileData.Add(data);
    }
    return View(fileData);
}
Public Function ViewFile() As ActionResult
	Dim fileData As New List(Of KeyValuePair(Of String, String))()
	Dim data As KeyValuePair(Of String, String)

	Dim files() As String = Directory.GetFiles(Server.MapPath("~/qrr"))
	For Each file As String In files
		' create a barcode reader instance
		Dim reader As IBarcodeReader = New BarcodeReader()
		' load a bitmap
		Dim barcodeBitmap = CType(Image.FromFile(Server.MapPath("~/qrr") & "/" & Path.GetFileName(file)), Bitmap)
		' detect and decode the barcode inside the bitmap
		Dim result = reader.Decode(barcodeBitmap)
		' do something with the result
		data = New KeyValuePair(Of String, String)(result.ToString(), "/QR/" & Path.GetFileName(file))
		fileData.Add(data)
	Next file
	Return View(fileData)
End Function
VB   C#
A Comparison between IronBarcode and ZXing.NET, Figure 15: QRコードの読み取りとデコード

QRコードの読み取りとデコード

A Comparison between IronBarcode and ZXing.NET, Figure 16: 解読されたQRコード

解読されたQRコード

ビットマップ内のバーコードをデコードする

// create a barcode reader instance
BarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.LoadFrom("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
   txtDecoderType.Text = result.BarcodeFormat.ToString();
   txtDecoderContent.Text = result.Text;
}
// create a barcode reader instance
BarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.LoadFrom("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
   txtDecoderType.Text = result.BarcodeFormat.ToString();
   txtDecoderContent.Text = result.Text;
}
' create a barcode reader instance
Dim reader As New BarcodeReader()
' load a bitmap
Dim barcodeBitmap = CType(Image.LoadFrom("C:\sample-barcode-image.png"), Bitmap)
' detect and decode the barcode inside the bitmap
Dim result = reader.Decode(barcodeBitmap)
' do something with the result
If result IsNot Nothing Then
   txtDecoderType.Text = result.BarcodeFormat.ToString()
   txtDecoderContent.Text = result.Text
End If
VB   C#

ZXingデコーダーオンライン

ZXing Decoder Online は、オンラインで利用可能なバーコードおよびQRコードのスキャナーで、デコードをサポートしています。 PNGまたはその他の形式のQRコード画像をアップロードすると、デコードが開始されます。 同様に、任意のデータに対してQRコードを生成することができます。 ほとんどの場合、その情報はQRコードでエンコードしたいURLまたはテキストになります。

ZXingデコーダーのウェブサイトに移動してください。

IronBarcodeとZXing.NETの比較、図17:デコードされたQRコード

ZXing デコーダー ウェブサイト

IronBarcodeとZXing.NETの比較, 図18: デコードされたQRコード

ZXing デコード結果

価格とライセンス

ZXing.NETライブラリは、バーコード読み取りアプリケーションを構築するための無料のオープンソースライブラリですが、Apacheライセンスに基づいて構築されており、商業目的での自由な使用は許可されていません。

IronBarcodeの開発者ライセンスは無料で提供されます。 IronBarcodeにはユニークな価格体系があります:Liteバンドルは追加費用なしで$599から始まります。 SaaSおよびOEMアイテムも再配布することができます。 各ライセンスには、永続ライセンス、開発/ステージング/本番の有効性、30日間の返金保証、1年間のソフトウェアサポートとアップグレードが含まれています。 (一回限りの購入). こちらをご覧ください ページ IronBarcode の完全な価格とライセンス情報を表示するために。

なぜIronBarcodeを選ぶのか?

IronBarcodeは、開発者が.NETでバーコードを読み書きするための使いやすいAPIを含んでおり、実際の使用シーンでの精度と低エラー率を最適化します。

たとえば、BarcodeWriterクラスは、UPCAおよびUPCEバーコードの「チェックサム」を検証および修正します。 短すぎて特定の数値形式に入力できない数字も「ゼロ埋め」されます。 指定されたデータ形式にデータが非対応の場合、IronBarcodeは開発者に最適なバーコード形式を通知します。

IronBarcodeは、バーコードがスキャンされたり、写真画像から読み取られたりしたとき、つまり、画像がグラフィック的に完璧でなく、機械生成されたスクリーンショットでない場合に、バーコードの読み取りに優れています。

IronBarcodeはZXing.NETとどう違いますか?

IronBarcodeはZXing.NETから作られています (ゼブラクロッシング) コアの性能が向上し、処理能力が改善されました。 それには使いやすいAPIが付属しており、ZXing.NETコアライブラリと比較してエラー率が低くなっています。 それだけでなく、IronBarcodeは通常のZXing.NETライブラリがサポートするバーコード形式よりも広範なバーコード形式をサポートしています。

IronBarcodeは、ZXing.NETのより改良されたバージョンであり、商業利用のためのプラットフォームをユーザーに提供し、複数のプラットフォームで同じパッケージを使用する可能性を与えます。 また、必要な場所ですぐにお手伝いするフルテクニカルサポートも備えています。

IronBarcode 自動回転、視点補正、デジタルノイズ補正を含み、画像にエンコードされたバーコードの種類を検出することができます。

結論

結論として、IronBarcodeは幅広いバーコード形式を読み取るための柔軟な.NETソフトウェアライブラリであり、スクリーンショット、写真、スキャン、その他の不完全な実写画像からも読み取ることができるC#のQRコードジェネレーターです。

IronBarcode は、バーコードの作成と識別のための最も効果的なライブラリの一つです。 バーコードの生成と識別に関しても、最も迅速なライブラリの一つです。 異なるオペレーティングシステムがライブラリと互換性があります。 設計が簡単で、幅広いバーコード形式をサポートしています。 さらに、さまざまな記号、形式、および文字がサポートされています。

ZXing.NETバーコードは、様々な画像フォーマットでバーコードを生成および認識する強力なライブラリです。 さまざまな形式の画像を読み取り、作成することができます。 ZXing.NETでは、バーコードの外観も変更することができます。高さ、幅、バーコードテキストなどを変更することができます。

ZXing.NETと比較して、IronBarcodeパッケージは信頼できるライセンスとサポートを提供します。 IronBarcodeのコストは$599です。 ZXingは無料ですが、商用利用の可能性がなく、全体的なサポートも欠如しています。 ZXing.NETよりも柔軟性があるだけでなく、IronBarcodeソリューションは機能も豊富です。 したがって、IronBarcodeはZXing.NETに比べて大きな優位性を持っていることが明らかです。

バーコードの認識および生成の処理時間を比較した場合、IronBarcodeはZXing.NETよりも優れています。 IronBarcodeは、さまざまな画像フォーマットやPDFドキュメントからバーコードを読み取ることができるいくつかのプロパティも備えています。 それに加えて、他のライブラリにはない機能として、バーコードやQRコード内に画像を含めることができます。

IronBarcodeは、開発の初期段階において無料で利用できます。 次の内容を日本語に翻訳します:

You can acquire a

次のライセンスを取得できます: 無料試用 本番レベルまたは商用利用用。 開発者の要件に応じて、IronBarcodeは三つの価格帯を提供しています。 ご要望に最も適したソリューションを選ぶことができます。 現在、2つのIron Software製品の価格で5つのIron Software製品のスイートを入手できます。 こちらをご覧ください ウェブサイト さらに詳しい情報については。

< 以前
ZXingデコーダーとIronBarcodeの比較
次へ >
IronBarcodeとアポスバーコードの比較

準備はできましたか? バージョン: 2024.8 新発売

無料のNuGetダウンロード 総ダウンロード数: 1,157,958 View Licenses >