IRONSOFTWAREHOME
バーコードリーダーのオプションを設定する
using IronBarCode;

BarcodeReaderOptions myOptionsExample = new BarcodeReaderOptions()
{
    // Choose a reading speed from: Faster, Balanced, Detailed, ExtremeDetail
    // There is a tradeoff in performance as more detail is set
    Speed = ReadingSpeed.Balanced,

    // Reader will stop scanning once a single barcode is found (if set to true)
    ExpectMultipleBarcodes = true,

    // By default, all barcode formats are scanned for
    // Specifying a subset of barcode types to search for would improve performance
    ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional,

    // Utilize multiple threads to read barcodes from multiple images in parallel
    Multithreaded = true,

    // Maximum threads for parallelized barcode reading
    // Default is 4
    MaxParallelThreads = 2,

    // The area of each image frame in which to scan for barcodes
    // Specifying a crop area will significantly improve performance and avoid noisy parts of the image
    CropArea = new System.Drawing.Rectangle(),

    // Special setting for Code39 barcodes
    // If a Code39 barcode is detected, try to read with both the base and extended ASCII character sets
    UseCode39ExtendedMode = true,

    // Minimum scan lines that must agree on a result for it to be valid
    // Default is 2. Set to 1 for thin or low-quality barcodes
    MinScanLines = 1
};
Imports IronBarCode

Dim myOptionsExample As New BarcodeReaderOptions() With {
    .Speed = ReadingSpeed.Balanced,
    .ExpectMultipleBarcodes = True,
    .ExpectBarcodeTypes = BarcodeEncoding.AllOneDimensional,
    .Multithreaded = True,
    .MaxParallelThreads = 2,
    .CropArea = New System.Drawing.Rectangle(),
    .UseCode39ExtendedMode = True,
    .MinScanLines = 1
}
NuGet Download
PM > Install-Package BarCode
バーコードリーダーのオプションを設定する

バーコードリーダーのオプションを設定する

IronBarcodeは、BarcodeReaderOptionsクラス内で、カスタマイズされた最適なバーコード読み取りを可能にするためのさまざまな設定を提供します。 これらのオプションは、リソースと精度をトレードオフしたり、読み取りの範囲を制御したり、読み取り戦略を最適化したりすることができます。

利用可能なBarcodeReaderOptionsタイプ

  • BarcodeReaderOptions: このクラスはバーコードの読み取りをカスタマイズするオプションを提供し、特定のニーズに基づいて処理をより効率的かつ正確にします。
  • TotalBarcodes: これを1に設定することで、最初のバーコードを見つけたら読み取りを停止し、1つのバーコードのみを期待する場合のパフォーマンスを向上させます。
  • TreatAllDecodersAs: バーコードの種類を自動で検出し、様々なバーコード形式を扱う際に処理を簡素化します。
  • CropRegion: 画像の特定の領域に焦点を絞ることができ、バーコードの位置がほぼわかっている場合に、読み取り時間と精度を大幅に改善できます。
  • MaxThreads: 並行して使用するスレッドの最大数を指定し、複数のCPUコアを持つシステムでの性能を向上させます。
  • MinScanLines: 有効と見なされるために、バーコード結果に合意する必要があるスキャンラインの最小数を設定します。 デフォルトは 2 です。これを 1 に下げると、薄かったり品質の低い BARCODE に対する感度が上がり、逆に上げると誤検出が減少します。

この構成は、リソース使用量、速度、精度のバランスを取りながら、特定のバーコード読み取りニーズに合わせて調整されています。

IronBarcodeで画像からバーコードを読み取る方法を学ぶ
GitHubで見る

準備はできましたか?

Nuget Downloads 2,422,100バージョン:2026.9リリースされたばかり

Key in blue circle

無料の30日間トライアルキーをすぐに入手してください。

Your trial license will be sent to your email address

制限なし。100% ロック解除済み。クレジットカード不要。

bullet_checkedクレジットカードやアカウントの作成は不要です。制限なし。100% ロック解除済み。クレジットカード不要。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
無料のライブデモを予約する
Booking Badge

世界中の数百万人のエンジニアから信頼されています。

ライセンスはより安く
義務のない相談を受ける
下記のフォームを記入するか、sales@ironsoftware.comにメールしてください。
あなたの詳細は常に守秘されます。
世界中の数百万人のエンジニアから信頼されています。
ライセンスはより安く
あなたの無料30日間の試用キーをすぐに入手。
クレジットカードやアカウントの作成は不要です。