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:此類提供選項來自訂條碼的讀取,使過程更有效率、準確,並符合特定需求。
  • 1後,讀取器將在找到第一個條碼後停止,當只期望單一條碼時可提升效能。
  • TreatAllDecodersAs:自動檢測條碼型別,當您擁有多樣的條碼格式時可簡化操作。
  • CropRegion:允許聚焦於圖像的特定區域,當條碼位置約略已知時,這可以顯著改善讀取時間和準確性。
  • MaxThreads:指定平行操作時使用的最大執行緒數量,提升有多核心CPU系統的效能。
  • MinScanLines:設定必須同意條碼結果的最少掃描線數量,以認為其有效。 預設為2。將其降低至1增加了對於細或低品質條碼的敏感性,增加則減少了誤判。

此配置在資源使用、速度和準確性之間提供了一個平衡,量身訂製適合您的條碼讀取需求。

學習如何使用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

全球數百萬工程師信賴

Iron Software的客戶標誌
獲取您的無義務諮詢
完成下方表單或發送電子郵件至sales@ironsoftware.com
您的詳細資訊將始終保密。
全球數百萬工程師信賴
Iron Software的客戶標誌
立即獲取您的30天試用金鑰
無需信用卡或帳戶建立