IronBarcode 始める Barcodes & QRs in C# & VB.NET Applications カーティス・チャウ 更新日:2026年1月31日 IronBarcode をダウンロード NuGet ダウンロード DLL ダウンロード 無料トライアル LLM向けのコピー LLM向けのコピー LLM 用の Markdown としてページをコピーする ChatGPTで開く このページについてChatGPTに質問する ジェミニで開く このページについてGeminiに問い合わせる Grokで開く このページについてGrokに質問する 困惑の中で開く このページについてPerplexityに問い合わせる 共有する Facebook で共有 Xでシェア(Twitter) LinkedIn で共有 URLをコピー 記事をメールで送る This article was translated from English: Does it need improvement? Translated View the article in English C#および他のすべて for .NET言語でバーコードを読み書きすることは、IronBarcodeソフトウェアライブラリを使用することで簡単です。 IronBarcodeのインストール 旅の最初のステップは、NuGetからダウンロードするかDLLをダウンロードすることで、IronBarcodeをインストールすることです。 IronBarcode NuGetパッケージをインストールするには、Visual StudioのNuGetパッケージマネージャを使用することができます。 Install-Package BarCode 代わりに、dotnet CLIを使用してインストールすることもできます。 dotnet add package IronBarCode バーコードまたはQRコードの読み取り IronBarcodeを使用すると、バーコードを読み取るのは1行のコードだけです。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-1.cs using IronBarCode; BarcodeResults results = BarcodeReader.Read("QuickStart.jpg"); if (results != null) { foreach (BarcodeResult result in results) { Console.WriteLine(result.Text); } } $vbLabelText $csharpLabel この1行のコードで、入力ドキュメントからすべての種類のバーコードを特定してスキャンする機能を持ち、抜群の性能を発揮します。すべてが1ステップで必要とされます。この方法は、JPEG、PNG、BMPなどのさまざまな画像形式、さらにはPDFやGIF、TIFFのような多フレーム形式をサポートしています。 性能を向上させるために、カスタマイズ可能な設定オプションが利用可能です。 読み取り速度を向上させるには、パフォーマンスが向上するように構成された Speed 設定を使用して、BarcodeReaderOptions オブジェクトを作成します。 デフォルトは Balanced ですが、特定のチェックをスキップするには Faster オプションを使用できます。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-2.cs using IronBarCode; BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions() { ExpectMultipleBarcodes = false, ExpectBarcodeTypes = BarcodeEncoding.QRCode | BarcodeEncoding.Code128, CropArea = new System.Drawing.Rectangle(100, 200, 300, 400), }; BarcodeResults result = BarcodeReader.Read("QuickStart.jpg", myOptionsExample); if (result != null) { Console.WriteLine(result.First().Text); } $vbLabelText $csharpLabel 読み取りプロセスを最適化するために、ScanMode を OnlyBasicScan に設定することもできます。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-3.cs using IronBarCode; BarcodeResults results = BarcodeReader.Read("MultipleBarcodes.png"); // Loop through the results foreach (BarcodeResult result in results) { string value = result.Value; Bitmap img = result.BarcodeImage; BarcodeEncoding barcodeType = result.BarcodeType; byte[] binary = result.BinaryValue; Console.WriteLine(result.Value); } $vbLabelText $csharpLabel 他の設定では、スキャンするバーコード形式を指定でき、不要なスキャンを減らすことで処理を高速化することができます。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-4.cs using IronBarCode; BarcodeResults pagedResults = BarcodeReader.Read("MultipleBarcodes.pdf"); // Loop through the results foreach (BarcodeResult result in pagedResults) { int pageNumber = result.PageNumber; string value = result.Value; Bitmap img = result.BarcodeImage; BarcodeEncoding barcodeType = result.BarcodeType; byte[] binary = result.BinaryValue; Console.WriteLine(result.Value); } // or from a multi-page TIFF scan with image correction: BarcodeResults multiFrameResults = BarcodeReader.Read(inputImage: "Multiframe.tiff", new BarcodeReaderOptions { Speed = ReadingSpeed.Detailed, ExpectMultipleBarcodes = true, ExpectBarcodeTypes = BarcodeEncoding.Code128, Multithreaded = false, RemoveFalsePositive = false, ImageFilters = null }); $vbLabelText $csharpLabel バーコードの書き込み IronBarcodeを使用してバーコードを書き込むには、BarcodeWriter クラスを使用します。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-5.cs using IronBarCode; GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128); myBarcode.SaveAsImage("myBarcode.png"); $vbLabelText $csharpLabel バーコードのスタイリング IronBarcodeは、バーコードの視覚的表現を操作するためのいくつかのオプションを提供します。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-7.cs using IronBarCode; GeneratedBarcode myBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128); myBarcode.AddAnnotationTextAboveBarcode("Product URL:"); myBarcode.AddBarcodeValueTextBelowBarcode(); myBarcode.SetMargins(100); myBarcode.ChangeBarCodeColor(IronSoftware.Drawing.Color.Purple); // All major image formats supported as well as PDF and HTML myBarcode.SaveAsPng("myBarcode.png"); $vbLabelText $csharpLabel バーコードのHTMLとしてのエクスポート IronBarcodeは、バーコードをHTMLドキュメントとして、またはHTMLコンテンツの一部としてエクスポートできます。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-8.cs using IronBarCode; QRCodeWriter.CreateQrCode("https://ironsoftware.com", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPdf("MyQR.pdf"); $vbLabelText $csharpLabel QRコードの生成 QR コードの場合は、エラー訂正などの QR 固有の機能の追加構成を提供する QRCodeWriter クラスを使用します。 :path=/static-assets/barcode/content-code-examples/get-started/get-started-9.cs using IronBarCode; using IronSoftware.Drawing; QRCodeLogo qrCodeLogo = new QRCodeLogo("visual-studio-logo.png"); GeneratedBarcode myQRCodeWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", qrCodeLogo); myQRCodeWithLogo.ChangeBarCodeColor(Color.DarkGreen).SaveAsPdf("MyQRWithLogo.pdf"); $vbLabelText $csharpLabel サポートされるバーコード形式 IronBarcodeは、読み書きの両方で多くの一般的に使用されるバーコード形式をサポートしています: QR、Micro QR、長方形のMicro QR (rMQR)コード。 Aztec、Data Matrix、MaxiCode、PDF417などの他の二次元バーコード。 Databarなどのスタック型一次元バーコード。 UPC-A、UPC-E、EAN-8、EAN-13、Codabar、ITF、MSI、Plesseyなどの通常の一次元バーコード形式。 IronBarcodeを選ぶ理由 IronBarcodeは、.NETのためのバーコードの読み書きのための開発者にとって使いやすく、実際のユースケースでの精度、精密さ、および速度を最適化するAPIを提供します。 たとえば、BarcodeWriter クラスは、UPCA および UPCE バーコードの"チェックサム"を自動的に検証および修正し、数値形式の制約を処理します。 IronBarcodeは、開発者がデータに最適なバーコード形式を選択するのを手助けします。 このライブラリは堅牢で、画像の事前処理技術(自動回転や画像ノイズ除去など)を使用して、バーコード検出成功率を最大化します。 今後のステップ IronBarcodeを最大限に活用するために、このドキュメンテーションセクション内のチュートリアルを読むことをお勧めします。また、GitHubで私たちを訪れてください。 カーティス・チャウ 今すぐエンジニアリングチームとチャット テクニカルライター Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。 準備はできましたか? Nuget ダウンロード 2,119,460 | バージョン: 2026.3 リリース 無料トライアル NuGet 無料ダウンロード 総ダウンロード数: 2,119,460 ライセンスを見る まだスクロールしていますか? すぐに証拠が欲しいですか? PM > Install-Package BarCode サンプルを実行する 文字列が BarCode になるのを見る。 NuGet 無料ダウンロード 総ダウンロード数: 2,119,460 ライセンスを見る