フッターコンテンツにスキップ
他のコンポーネントと比較する

ZXing.orgのQRコードライブラリとIronBarcodeの包括的な比較

もしすでに技術電話/管理電話のバーコードの電子画像を持っていて、それを英語のテキストデータとして解読したい場合、バーコードスキャナーは最適なツールではないかもしれません。 さらに、バーコードスキャナーは1Dバーコードのみを読み取ることができ、ストレージ容量、ドメインステータス、サポートされている形式が制限されており、Windows RTクラスライブラリとしか使用できません。 現在では、2Dバーコード(QRコードとも呼ばれます)がより一般的で、更新日といったより多くの情報を格納できます。

.NETにサポートされているため、サードパーティのツールやAPIに頼ることなく、Windows、MacOS、Linuxでバーコードスキャンアプリケーションが動作できます。

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図2 - ウェブアプリケーション

スパムを避けるためには、多くの企業にとってバーコードの作成とスキャンが不可欠になっています。 バーコードを作成するための2つの人気ツールは、オープンソースプロジェクトZXingのデコードとIronBarcodeです。 この記事では、これらの各ツールの機能と利点を探求し、比較します。

ZXingデコーダー

ZXingは、1Dおよび2Dバーコードを生成およびデコードするための人気のあるオープンソースライブラリです。

Java、C++、.NETを含む複数のプログラミング言語をサポートしています。

ZXingデコーダーオンラインは、バーコードやQRコードイメージをスキャンおよびデコードできるウェブベースのツールです。 さらに、ユーザーは通常URLまたはエンコードしたいテキストの形式で情報用にQRコードを作成できます。

ZXingオンラインデコーダーを使用するには、次の手順に従ってください:

  1. ZXingデコーダーオンラインのウェブサイトを訪問します。

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図2 - Googleが開発したZXing Web

  1. "ファイルを選択"ボタンをクリックして、QRコードの画像ファイルを選択します。
  2. 画像を選択したら、"送信"ボタンをクリックします。

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図3 - ZXingデコード

  1. 認識可能なコードが見つかった場合、ツールはQRコードをデコードして結果の情報を表示します。

ライブラリは使いやすく、ウェブアプリケーション、モバイルアプリ、デスクトップアプリケーションに統合できます。

ZXingは広く採用されており、多くの開発者コミュニティがその開発への貢献やサポートを提供しています。

ライブラリは、デバイスモデルやOSのバージョンなどのデバイス情報を収集し、潜在的なセキュリティリスクと見なされることがあります。

さらに、独立した組織によって維持されていないため、ライブラリの所有権と管理について懸念が提起されています。

全体として、ZXingはバーコードの生成とデコードにおいて強力で多用途のライブラリであり、広く採用され、コミュニティのサポートがあります。

たとえば、ZXingを使用してQRコードを生成するには、開発者は数行のコードを書く必要があります:

using ZXing;
using ZXing.QrCode;

// Create a BarcodeWriter instance to generate QR codes
BarcodeWriter writer = new BarcodeWriter
{
    Format = BarcodeFormat.QR_CODE // Set format to QR_CODE
};

// Generate a QR code with the text "Hello, ZXing!"
Bitmap qrCode = writer.Write("Hello, ZXing!");
using ZXing;
using ZXing.QrCode;

// Create a BarcodeWriter instance to generate QR codes
BarcodeWriter writer = new BarcodeWriter
{
    Format = BarcodeFormat.QR_CODE // Set format to QR_CODE
};

// Generate a QR code with the text "Hello, ZXing!"
Bitmap qrCode = writer.Write("Hello, ZXing!");
Imports ZXing
Imports ZXing.QrCode

' Create a BarcodeWriter instance to generate QR codes
Private writer As New BarcodeWriter With {.Format = BarcodeFormat.QR_CODE}

' Generate a QR code with the text "Hello, ZXing!"
Private qrCode As Bitmap = writer.Write("Hello, ZXing!")
$vbLabelText   $csharpLabel

ZXingプロジェクトを使用してQRコードをデコードするために、開発者は次のコードを使用できます:

using ZXing;
using ZXing.QrCode;

// Create a BarcodeReader instance for decoding QR codes
BarcodeReader reader = new BarcodeReader();

// Decode the QR code from a bitmap image
Result result = reader.Decode(qrCode);

// Extract the text from the decoded QR code
string text = result.Text;
using ZXing;
using ZXing.QrCode;

// Create a BarcodeReader instance for decoding QR codes
BarcodeReader reader = new BarcodeReader();

// Decode the QR code from a bitmap image
Result result = reader.Decode(qrCode);

// Extract the text from the decoded QR code
string text = result.Text;
Imports ZXing
Imports ZXing.QrCode

' Create a BarcodeReader instance for decoding QR codes
Private reader As New BarcodeReader()

' Decode the QR code from a bitmap image
Private result As Result = reader.Decode(qrCode)

' Extract the text from the decoded QR code
Private text As String = result.Text
$vbLabelText   $csharpLabel

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図4 - QRコードジェネレーター

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図5 - QRコードファイルの表示

IronBarcodeの紹介

IronBarcodeは、Iron Softwareによって作成された.NET開発者向けの強力なバーコード生成およびスキャンライブラリです。

IronBarcodeは、開発者がQRコード、データマトリックスコード、UPC-Aバーコードを含む様々なバーコードタイプを生成およびスキャンするための使いやすいAPIを提供します。

IronBarcodeライブラリは、ZXing.NETライブラリの機能を拡張する方法としてIron Softwareによって作成されました。

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図6 - サポートされるバーコード形式

新機能と機能性を追加し、2Dバーコード、PDF417バーコードの生成や画像ファイルからのバーコード読み取りが可能になります。

IronBarcodeを使用してQRコードを生成する方法の例を次に示します:

using IronBarCode;

// Generate a QR code with the text "Hello, IronBarcode!"
var barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode);

// Save the generated QR code as a PNG image
barcode.SaveAsImage("qrcode.png");
using IronBarCode;

// Generate a QR code with the text "Hello, IronBarcode!"
var barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode);

// Save the generated QR code as a PNG image
barcode.SaveAsImage("qrcode.png");
Imports IronBarCode

' Generate a QR code with the text "Hello, IronBarcode!"
Private barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode)

' Save the generated QR code as a PNG image
barcode.SaveAsImage("qrcode.png")
$vbLabelText   $csharpLabel

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図7 - QRコード

IronBarcodeを使用してバーコードをスキャンするには、次のコードを使用できます:

using IronBarCode;

// Read the QR code from the image file "qrcode.png"
var barcode = BarcodeReader.ReadBarcode("qrcode.png", BarcodeEncoding.QRCode);

// Extract the text from the decoded QR code
string text = barcode.Text;
using IronBarCode;

// Read the QR code from the image file "qrcode.png"
var barcode = BarcodeReader.ReadBarcode("qrcode.png", BarcodeEncoding.QRCode);

// Extract the text from the decoded QR code
string text = barcode.Text;
Imports IronBarCode

' Read the QR code from the image file "qrcode.png"
Private barcode = BarcodeReader.ReadBarcode("qrcode.png", BarcodeEncoding.QRCode)

' Extract the text from the decoded QR code
Private text As String = barcode.Text
$vbLabelText   $csharpLabel

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図8 - C#でのバーコード画像の作成

IronBarcodeは、2Dバーコード、UPC-A、UPC-E、EAN-8、EAN-13、Code39、Code128、PDF417などの幅広いバーコードタイプをサポートしています。

ZXing.NETライブラリの強みを活かし、バーコードのスキャンと生成の速度と精度を向上させ、新機能と機能を追加しています。

IronBarcodeの使用法

IronBarcodeの使用方法については、次の手順を参照してください:

ステップ1: IronBarcodeライブラリのインストール

.NETプロジェクトでIronBarcodeを使用するには、まずNuGetを使用してIronBarcodeライブラリをインストールする必要があります。 NuGetパッケージマネージャーコンソールで以下のコマンドを実行することで、この作業を行えます:

Install-Package BarCode

ステップ2: バーコードの生成

IronBarcodeを使用してバーコードを生成するには、BarcodeWriterクラスを使用できます。

using IronBarCode;

// Generate a QR code with the text "Hello, IronBarcode!"
var barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode);

// Save the generated QR code as an image file
barcode.SaveAsImage("qrcode.png");
using IronBarCode;

// Generate a QR code with the text "Hello, IronBarcode!"
var barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode);

// Save the generated QR code as an image file
barcode.SaveAsImage("qrcode.png");
Imports IronBarCode

' Generate a QR code with the text "Hello, IronBarcode!"
Private barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode)

' Save the generated QR code as an image file
barcode.SaveAsImage("qrcode.png")
$vbLabelText   $csharpLabel

このコードは、"Hello, IronBarcode!"というテキストのQRコードを作成し、それを"qrcode.png"という名前の画像ファイルとして保存します。

ステップ3: バーコードのスキャン

IronBarcodeを使用してバーコードをスキャンするには、BarcodeReaderクラスを使用できます。

using IronBarCode;

// Read the QR code from the image file "qrcode.png"
var barcode = BarcodeReader.ReadBarcode("qrcode.png", BarcodeEncoding.QRCode);

// Extract the text from the decoded QR code
string text = barcode.Text;
using IronBarCode;

// Read the QR code from the image file "qrcode.png"
var barcode = BarcodeReader.ReadBarcode("qrcode.png", BarcodeEncoding.QRCode);

// Extract the text from the decoded QR code
string text = barcode.Text;
Imports IronBarCode

' Read the QR code from the image file "qrcode.png"
Private barcode = BarcodeReader.ReadBarcode("qrcode.png", BarcodeEncoding.QRCode)

' Extract the text from the decoded QR code
Private text As String = barcode.Text
$vbLabelText   $csharpLabel

このコードは画像ファイル"qrcode.png"からQRコードを読み取り、バーコードにエンコードされたテキストを返します。

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図9 - バーコードのスキャン

ステップ4: バーコードのカスタマイズ

IronBarcodeは、生成されたバーコードスキャン実装の外観と動作を制御できる一連のカスタマイズオプションを提供します。

ironbarcode for バーコードスキャン実装を使用してQRコードをカスタマイズする方法の例を次に示します:

using IronBarCode;

// Customize a QR code
var barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode);
barcode.ResizeTo(400, 400); // Resize the barcode
barcode.SetMargins(20); // Set margins around the barcode
barcode.SetForegroundColor(Color.Black); // Set the foreground color
barcode.SetBackgroundColor(Color.White); // Set the background color
barcode.AddCaptionAbove("Scan me with your smartphone!"); // Add a caption above the barcode
barcode.AddImageLogo("logo.png", 80, 80); // Add a logo to the barcode
barcode.SaveAsImage("qrcode.png"); // Save the customized barcode as an image
using IronBarCode;

// Customize a QR code
var barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode);
barcode.ResizeTo(400, 400); // Resize the barcode
barcode.SetMargins(20); // Set margins around the barcode
barcode.SetForegroundColor(Color.Black); // Set the foreground color
barcode.SetBackgroundColor(Color.White); // Set the background color
barcode.AddCaptionAbove("Scan me with your smartphone!"); // Add a caption above the barcode
barcode.AddImageLogo("logo.png", 80, 80); // Add a logo to the barcode
barcode.SaveAsImage("qrcode.png"); // Save the customized barcode as an image
Imports IronBarCode

' Customize a QR code
Private barcode = BarcodeWriter.CreateBarcode("Hello, IronBarcode!", BarcodeWriterEncoding.QRCode)
barcode.ResizeTo(400, 400) ' Resize the barcode
barcode.SetMargins(20) ' Set margins around the barcode
barcode.SetForegroundColor(Color.Black) ' Set the foreground color
barcode.SetBackgroundColor(Color.White) ' Set the background color
barcode.AddCaptionAbove("Scan me with your smartphone!") ' Add a caption above the barcode
barcode.AddImageLogo("logo.png", 80, 80) ' Add a logo to the barcode
barcode.SaveAsImage("qrcode.png") ' Save the customized barcode as an image
$vbLabelText   $csharpLabel

このコードは、"Hello, IronBarcode!"というテキストのQRコードを生成し、400x400ピクセルにサイズ変更し、20ピクセルのマージンを追加し、前景色を黒、背景色を白に設定し、バーコードの上にキャプションを追加し、画像を追加します。

IronBarcodeの機能

IronBarcodeはオープンソースのZXingライブラリを基盤にしていますが、その機能を拡張してQRコード、Code 128、Code 39、EAN-13、EAN-8、UPC-A、その他多くのバーコードタイプをサポートします。

IronBarcodeができることのいくつかは次のとおりです:

バーコード生成

IronBarcodeは、色、テキスト、画像オーバーレイなどのカスタマイズ可能な機能を備えた、さまざまなタイプとスタイルの線形および2Dバーコードを簡単に生成できます。 次のコードスニペットはQRコードを生成します:

var barcode = IronBarCode.BarcodeWriter.CreateBarcode("Hello World!", IronBarCode.BarcodeWriterEncoding.QRCode);
barcode.SaveAsJpeg("QRCode.jpg");
var barcode = IronBarCode.BarcodeWriter.CreateBarcode("Hello World!", IronBarCode.BarcodeWriterEncoding.QRCode);
barcode.SaveAsJpeg("QRCode.jpg");
Dim barcode = IronBarCode.BarcodeWriter.CreateBarcode("Hello World!", IronBarCode.BarcodeWriterEncoding.QRCode)
barcode.SaveAsJpeg("QRCode.jpg")
$vbLabelText   $csharpLabel

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図10 - Code128バーコード画像

バーコード読み取り

IronBarcodeは、画像、PDF、およびライブカメラストリームからバーコードを読み取ることができる強力なバーコードスキャナーも提供します。 次のコードは、画像ファイルからQRコードを読み取ります:

var barcode = IronBarCode.BarcodeReader.Read("QRCode.jpg", IronBarCode.BarcodeReaderEncoding.QRCode);
Console.WriteLine(barcode.Text);
var barcode = IronBarCode.BarcodeReader.Read("QRCode.jpg", IronBarCode.BarcodeReaderEncoding.QRCode);
Console.WriteLine(barcode.Text);
Dim barcode = IronBarCode.BarcodeReader.Read("QRCode.jpg", IronBarCode.BarcodeReaderEncoding.QRCode)
Console.WriteLine(barcode.Text)
$vbLabelText   $csharpLabel

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図11 - PDF内に保存されたバーコードの読み取り

バーコードの検証

IronBarcodeは、他のバーコードリーダーでのスキャンを可能にするためにバーコードが有効であることを確認するために検証することもできます。 次のコードスニペットは、Code 128バーコードを検証します:

var barcode = IronBarCode.BarcodeReader.Read("Code128.jpg", IronBarCode.BarcodeReaderEncoding.Code128);

// Check if the barcode is valid
if (barcode.IsValid)
{
    Console.WriteLine("Barcode is valid.");
}
else
{
    Console.WriteLine("Barcode is invalid.");
}
var barcode = IronBarCode.BarcodeReader.Read("Code128.jpg", IronBarCode.BarcodeReaderEncoding.Code128);

// Check if the barcode is valid
if (barcode.IsValid)
{
    Console.WriteLine("Barcode is valid.");
}
else
{
    Console.WriteLine("Barcode is invalid.");
}
Dim barcode = IronBarCode.BarcodeReader.Read("Code128.jpg", IronBarCode.BarcodeReaderEncoding.Code128)

' Check if the barcode is valid
If barcode.IsValid Then
	Console.WriteLine("Barcode is valid.")
Else
	Console.WriteLine("Barcode is invalid.")
End If
$vbLabelText   $csharpLabel

バーコードの変換

IronBarcodeは、Code 39バーコードをQRコードに変換するなど、1つの形式から別の形式にバーコードを変換できます。 次のコードスニペットは、Code 39バーコードをQRコードに変換します:

var barcode = IronBarCode.BarcodeReader.Read("Code39.jpg", IronBarCode.BarcodeReaderEncoding.Code39);
var qrCode = IronBarCode.BarcodeWriter.CreateBarcode(barcode.Text, IronBarCode.BarcodeWriterEncoding.QRCode);
qrCode.SaveAsJpeg("QRCode.jpg");
var barcode = IronBarCode.BarcodeReader.Read("Code39.jpg", IronBarCode.BarcodeReaderEncoding.Code39);
var qrCode = IronBarCode.BarcodeWriter.CreateBarcode(barcode.Text, IronBarCode.BarcodeWriterEncoding.QRCode);
qrCode.SaveAsJpeg("QRCode.jpg");
Dim barcode = IronBarCode.BarcodeReader.Read("Code39.jpg", IronBarCode.BarcodeReaderEncoding.Code39)
Dim qrCode = IronBarCode.BarcodeWriter.CreateBarcode(barcode.Text, IronBarCode.BarcodeWriterEncoding.QRCode)
qrCode.SaveAsJpeg("QRCode.jpg")
$vbLabelText   $csharpLabel

IronBarcodeがZXingデコーダーオンラインより優れている点

IronBarcodeがZXingより優れている方法のいくつかを以下に示します:

  1. パフォーマンス: IronBarcodeはZXingよりも高速で、高速なバーコードスキャンと生成を必要とするウェブアプリケーションに最適です。
  2. 使いやすさ: IronBarcodeのAPIはシンプルで直感的で、数行のコードでバーコードを作成したりスキャンしたりするのが簡単です。 一方で、ZXingのAPIは複雑で初心者には使いにくいことがあります。
  3. 出力品質: IronBarcodeは、小さいサイズでも読みやすい高品質のバーコードを生成します。 対照的に、ZXingのバーコードは特に小さいサイズでは読み取るのが難しいことがあります。
  4. サポートされている形式: IronBarcodeは、UPC-A、2Dバーコードなどの幅広いバーコード形式をサポートします。 これに対し、ZXingプロジェクトは限られた数のバーコード形式しかサポートしていません。
  5. ライセンス: IronBarcodeは、ライブラリを無料で使用したり、ニーズに応じてライセンスを購入したりできる柔軟なライセンスモデルを提供しています。 対照的に、ZXingのライセンスは商用プロジェクトでライブラリを使用するのが難しいように制限されています。

ZXing.org QR Code LibraryとIronBarcode: 非常に詳細な比較: 図12 - マルチフレームTIFF画像からバーコードを読み取る

IronBarcodeは、パフォーマンス、使いやすさ、出力品質、サポートされている形式、およびライセンスにおいてZXingより優れたライブラリです。

IronBarcodeの優位性を自身で確認してみましょう

以下の無料のバーコード読み取りデモを使用して、IronBarcodeが提供するすべての機能を試してみてください。

barcode-demo--thumbnail {

position: relative; width: 100%; height: 450px; background-image: url(/img/freetools/barcode-demo.png); background-repeat: no-repeat; background-size: cover; cursor: pointer;

&:hover a.btn-red { background: #c9041e; border-color: #2a95d5; box-shadow: 0 0 12px 4px #dee2e2; text-decoration: none; }

a.btn.btn-red { position: absolute; top: 50%; left: 50%; font-family: "Gotham-Medium"; font-weight: 500; width: 280px; transform: translate(-50%, -50%); } }

### IronBarcodeは無料の試用版も提供しています IronBarcodeを試して、そのバーコードスキャンと生成能力を向上させる方法を確認したい方におすすめです。 IronBarcodeの機能と利点を試すための無料試用版を提供しています。 試用期間中は、幅広いバーコード形式のサポート、高度なカスタマイズオプション、既存プロジェクトとのシームレスな統合を含むIronBarcodeのすべての強力な機能にフルアクセスできます。 ZXingはその所有者の登録商標です。 このサイトは、ZXingと提携したり承認されたりスポンサーされたりしていません。 すべての製品名、ロゴ、およびブランドは各所有者の所有物です。 比較は情報提供のみを目的としており、執筆時点で公開されている情報を反映しています。)}]

よくある質問

バーコードスキャンにおけるZXingの制限は何ですか?

ZXingはバーコードスキャンのための人気のあるオープンソースライブラリですが、統合が複雑であり、潜在的なセキュリティリスクを伴う可能性があります。また、形式のサポートもIronBarcodeのような商用の代替品に比べて限られています。

どうやって.NETでQRコードをデコードすることができますか?

IronBarcodeを使用して.NETでQRコードをデコードできます。このクラスは、バーコード画像の読み取りと解釈のための簡単なAPIを提供します。

IronBarcodeのZXingに対する利点は何ですか?

IronBarcodeは、より迅速なパフォーマンス、データマトリックスやPDF417のサポートを含むより幅広い形式のサポートを提供し、バーコードの外観においても強化されたカスタマイズオプションを持つ、よりユーザーフレンドリーな体験を提供します。

どうやって.NETの開発者がカスタマイズされた外観のバーコードを生成できますか?

IronBarcodeを使用すると、開発者はサイズ変更、マージンの設定、色の変更、キャプションの追加、画像やロゴのオーバーレイを通じて、柔軟なAPIを使用してバーコードをカスタマイズすることができます。

IronBarcodeが.NET開発者にとって多用途のツールである理由は何ですか?

IronBarcodeは、サードパーティの依存関係なしで様々なプラットフォームをサポートしており、バーコード生成とスキャンのための堅固なツールセットを提供し、包括的なカスタマイズとフォーマットオプションを含みます。

どうやってバーコードライブラリを.NETアプリケーションに統合することができますか?

IronBarcodeを.NETアプリケーションに統合するには、NuGet経由でインストールし、そのAPIを使用して、セットアップを最小限にして効率的にバーコードを生成およびスキャンします。

IronBarcodeを購入前に試すことはできますか?

はい、Iron SoftwareのウェブサイトからIronBarcodeの無料試用版をダウンロードでき、試用期間中はその機能にフルアクセスできます。

商用バーコードライブラリの利点は何ですか?

IronBarcodeのような商用バーコードライブラリは、パフォーマンスの向上、使いやすさ、出力品質の向上、より広範な形式のサポート、オープンソースの代替品と比べてより柔軟なライセンシングを提供します。

Jordi Bardia
ソフトウェアエンジニア
Jordiは、最も得意な言語がPython、C#、C++であり、Iron Softwareでそのスキルを発揮していない時は、ゲームプログラミングをしています。製品テスト、製品開発、研究の責任を分担し、Jordiは継続的な製品改善において多大な価値を追加しています。この多様な経験は彼を挑戦させ続け、興味を持たせており、Iron Softwareで働くことの好きな側面の一つだと言います。Jordiはフロリダ州マイアミで育ち、フロリダ大学でコンピュータサイエンスと統計学を学びました。