C#'ta Barkodları Nasıl Okursunuz

C# Barcode Scanner: Read Barcodes & QR Codes in .NET Applications

This article was translated from English: Does it need improvement?
Translated
View the article in English

.NET uygulamanızda hızlı bir şekilde barkod veya QR kodlarını taramanız mı gerekiyor? IronBarcode, ister mükemmel dijital görüntüleri işliyor olun, ister zorlu gerçek dünya fotoğraflarını, barkod okuma işlemini basit ve güvenilir yapar. Bu rehber, C# ile barkod taramayı nasıl uygulayacağınızı, derhal kullanabileceğiniz pratik örneklerle gösterir.

Hızlı Başlangıç: Bir Dosyadan Anında Barkod Okuma

Bu hızlı örnek, IronBarcode ile başlamanın ne kadar kolay olduğunu gösterir. Sadece bir satır kod ile görüntü dosyasından barkod okuyabilirsiniz - karmaşık kurulum gerekmez.

  1. NuGet Paket Yöneticisi ile https://www.nuget.org/packages/BarCode yükleyin

    PM > Install-Package BarCode
  2. Bu kod parçasını kopyalayıp çalıştırın.

    var results = IronBarCode.BarcodeReader.Read("path/to/barcode.png");
  3. Canlı ortamınızda test etmek için dağıtın

    Bugün projenizde IronBarcode kullanmaya başlayın ücretsiz deneme ile

    arrow pointer

IronBarcode'u .NET projemde nasıl kurarım?

IronBarcode, NuGet Paket Yöneticisi aracılığıyla veya DLL'i doğrudan indirerek kolaylıkla kurulur. NuGet kurulumu, bağımlılıkları ve güncellemeleri otomatik olarak yönettikçe önerilen yaklaşımdır.

Install-Package BarCode

Kurulumdan sonra, barkod tarama işlevine erişmek için using IronBarCode; kodunu C# dosyalarınıza ekleyin. Farklı geliştirme ortamlarıyla ilgili ayrıntılı kurulum talimatları için kurulum kılavuzumuza bakın.

İlk barkodumu C# kullanarak nasıl okuyabilirim?

IronBarcode ile barkod okumak sadece bir satır kod gerektirir. Kütüphane, barkod formatlarını otomatik olarak algılar ve kodlanmış tüm verileri çıkarır.

Code128 barcode ready for scanning - contains text 'https://ironsoftware.com/csharp/barcode/' *IronBarcode'un anında okuyabileceği standart bir Code128 barkodu*
using IronBarCode;
using System;

// Read barcodes from the image file - supports PNG, JPG, BMP, GIF, and more
BarcodeResults results = BarcodeReader.Read("GetStarted.png");

// Check if any barcodes were detected
if (results != null && results.Count > 0)
{
    // Process each barcode found in the image
    foreach (BarcodeResult result in results)
    {
        // Extract the text value from the barcode
        Console.WriteLine("Barcode detected! Value: " + result.Text);

        // Additional properties available:
        // result.BarcodeType - The format (Code128, QR, etc.)
        // result.BinaryValue - Raw binary data if applicable
        // result.Confidence - Detection confidence score
    }
}
else
{
    Console.WriteLine("No barcodes detected in the image.");
}
using IronBarCode;
using System;

// Read barcodes from the image file - supports PNG, JPG, BMP, GIF, and more
BarcodeResults results = BarcodeReader.Read("GetStarted.png");

// Check if any barcodes were detected
if (results != null && results.Count > 0)
{
    // Process each barcode found in the image
    foreach (BarcodeResult result in results)
    {
        // Extract the text value from the barcode
        Console.WriteLine("Barcode detected! Value: " + result.Text);

        // Additional properties available:
        // result.BarcodeType - The format (Code128, QR, etc.)
        // result.BinaryValue - Raw binary data if applicable
        // result.Confidence - Detection confidence score
    }
}
else
{
    Console.WriteLine("No barcodes detected in the image.");
}
Imports IronBarCode
Imports System

' Read barcodes from the image file - supports PNG, JPG, BMP, GIF, and more
Dim results As BarcodeResults = BarcodeReader.Read("GetStarted.png")

' Check if any barcodes were detected
If results IsNot Nothing AndAlso results.Count > 0 Then
    ' Process each barcode found in the image
    For Each result As BarcodeResult In results
        ' Extract the text value from the barcode
        Console.WriteLine("Barcode detected! Value: " & result.Text)

        ' Additional properties available:
        ' result.BarcodeType - The format (Code128, QR, etc.)
        ' result.BinaryValue - Raw binary data if applicable
        ' result.Confidence - Detection confidence score
    Next
Else
    Console.WriteLine("No barcodes detected in the image.")
End If
$vbLabelText   $csharpLabel

BarcodeReader.Read metodu, tespit edilen tüm barkodları içeren bir BarcodeResults koleksiyonu döndürür. Her BarcodeResult, barkodun metin değerine, format türüne, konum koordinatlarına ve ikili verisine erişim sağlar. Bu yaklaşım, Code128, Code39, QR kodları ve Veri Matriks kodları dahil olmak üzere yaygın barkod formatları ile sorunsuz çalışır.

Zorlu veya hasarlı barkodları okumaya yardımcı olan hangi seçenekler var?

Gerçek dünya barkod taraması genellikle kusurlu görüntüleri içerir - eğik açılar, zayıf aydınlatma veya kısmi hasar. IronBarcode'un gelişmiş seçenekleri bu zorluklarla etkili bir şekilde başa çıkar.

using IronBarCode;

// Configure advanced reading options for difficult barcodes
BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Speed settings: Faster, Balanced, Detailed, ExtremeDetail
    // ExtremeDetail performs deep analysis for challenging images
    Speed = ReadingSpeed.ExtremeDetail,

    // Specify expected formats to improve performance
    // Use bitwise OR (|) to combine multiple formats
    ExpectBarcodeTypes = BarcodeEncoding.QRCode | BarcodeEncoding.Code128,

    // Maximum number of barcodes to find (0 = unlimited)
    MaxParallelThreads = 4,

    // Crop region for faster processing of specific areas
    CropArea = null // Or specify a Rectangle
};

// Apply options when reading
BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

// Process detected barcodes
foreach (var barcode in results)
{
    Console.WriteLine($"Format: {barcode.BarcodeType}, Value: {barcode.Text}");
}
using IronBarCode;

// Configure advanced reading options for difficult barcodes
BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Speed settings: Faster, Balanced, Detailed, ExtremeDetail
    // ExtremeDetail performs deep analysis for challenging images
    Speed = ReadingSpeed.ExtremeDetail,

    // Specify expected formats to improve performance
    // Use bitwise OR (|) to combine multiple formats
    ExpectBarcodeTypes = BarcodeEncoding.QRCode | BarcodeEncoding.Code128,

    // Maximum number of barcodes to find (0 = unlimited)
    MaxParallelThreads = 4,

    // Crop region for faster processing of specific areas
    CropArea = null // Or specify a Rectangle
};

// Apply options when reading
BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

// Process detected barcodes
foreach (var barcode in results)
{
    Console.WriteLine($"Format: {barcode.BarcodeType}, Value: {barcode.Text}");
}
Imports IronBarCode

' Configure advanced reading options for difficult barcodes
Private options As New BarcodeReaderOptions With {
	.Speed = ReadingSpeed.ExtremeDetail,
	.ExpectBarcodeTypes = BarcodeEncoding.QRCode Or BarcodeEncoding.Code128,
	.MaxParallelThreads = 4,
	.CropArea = Nothing
}

' Apply options when reading
Private results As BarcodeResults = BarcodeReader.Read("TryHarderQR.png", options)

' Process detected barcodes
For Each barcode In results
	Console.WriteLine($"Format: {barcode.BarcodeType}, Value: {barcode.Text}")
Next barcode
$vbLabelText   $csharpLabel
QR code rotated 45 degrees demonstrating IronBarcode's rotation handling *Gelişmiş seçenekleri kullanarak IronBarcode'un başarıyla okuduğu döndürülmüş QR kodu*

ExpectBarcodeTypes özelliği, aramayı belirli formatlarla sınırlayarak performansı önemli ölçüde artırır. Sorunlu görüntülerde maksimum hassasiyet için, görüntü filtreleri ile otomatik rotasyonu birleştirin:

using IronBarCode;

BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Apply image processing filters to enhance readability
    ImageFilters = new ImageFilterCollection
    {
        new AdaptiveThresholdFilter(9, 0.01f), // Handles varying lighting
        new ContrastFilter(2.0f),               // Increases contrast
        new SharpenFilter()                     // Reduces blur
    },

    // Automatically rotate to find barcodes at any angle
    AutoRotate = true,

    // Use multiple CPU cores for faster processing
    Multithreaded = true
};

BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

foreach (var result in results)
{
    Console.WriteLine($"Detected {result.BarcodeType}: {result.Text}");
    Console.WriteLine($"Confidence: {result.Confidence}%");
    Console.WriteLine($"Position: X={result.X}, Y={result.Y}");
}
using IronBarCode;

BarcodeReaderOptions options = new BarcodeReaderOptions
{
    // Apply image processing filters to enhance readability
    ImageFilters = new ImageFilterCollection
    {
        new AdaptiveThresholdFilter(9, 0.01f), // Handles varying lighting
        new ContrastFilter(2.0f),               // Increases contrast
        new SharpenFilter()                     // Reduces blur
    },

    // Automatically rotate to find barcodes at any angle
    AutoRotate = true,

    // Use multiple CPU cores for faster processing
    Multithreaded = true
};

BarcodeResults results = BarcodeReader.Read("TryHarderQR.png", options);

foreach (var result in results)
{
    Console.WriteLine($"Detected {result.BarcodeType}: {result.Text}");
    Console.WriteLine($"Confidence: {result.Confidence}%");
    Console.WriteLine($"Position: X={result.X}, Y={result.Y}");
}
Imports IronBarCode

Private options As New BarcodeReaderOptions With {
	.ImageFilters = New ImageFilterCollection From {
		New AdaptiveThresholdFilter(9, 0.01F),
		New ContrastFilter(2.0F),
		New SharpenFilter()
	},
	.AutoRotate = True,
	.Multithreaded = True
}

Private results As BarcodeResults = BarcodeReader.Read("TryHarderQR.png", options)

For Each result In results
	Console.WriteLine($"Detected {result.BarcodeType}: {result.Text}")
	Console.WriteLine($"Confidence: {result.Confidence}%")
	Console.WriteLine($"Position: X={result.X}, Y={result.Y}")
Next result
$vbLabelText   $csharpLabel

Bu gelişmiş özellikler, IronBarcode'u fotoğraflardan barkod tarama, güvenlik kameraları veya görüntü kalitesinin önemli ölçüde değiştiği mobil cihaz çekimleri için ideal hale getirir.

PDF belgelerinden birden çok barkod nasıl tararım?

PDF barkod tarama, faturaları, sevkiyat etiketlerini ve envanter belgelerini işlemek için esastır. IronBarcode, her sayfanın üzerindeki tüm barkodları verimli bir şekilde okur.

PDF dosyalarından barkodları okuma

using System;
using IronBarCode;

try
{
    // Scan all pages of a PDF for barcodes
    BarcodeResults results = BarcodeReader.ReadPdf("MultipleBarcodes.pdf");

    if (results != null && results.Count > 0)
    {
        foreach (var barcode in results)
        {
            // Access barcode data and metadata
            string value = barcode.Text;
            int pageNumber = barcode.PageNumber;
            BarcodeEncoding format = barcode.BarcodeType;
            byte[] binaryData = barcode.BinaryValue;

            // Extract barcode image if needed
            System.Drawing.Bitmap barcodeImage = barcode.BarcodeImage;

            Console.WriteLine($"Found {format} on page {pageNumber}: {value}");
        }
    }
    else
    {
        Console.WriteLine("No barcodes found in the PDF.");
    }
}
catch (Exception ex)
{
    Console.WriteLine($"Error reading PDF: {ex.Message}");
}
using System;
using IronBarCode;

try
{
    // Scan all pages of a PDF for barcodes
    BarcodeResults results = BarcodeReader.ReadPdf("MultipleBarcodes.pdf");

    if (results != null && results.Count > 0)
    {
        foreach (var barcode in results)
        {
            // Access barcode data and metadata
            string value = barcode.Text;
            int pageNumber = barcode.PageNumber;
            BarcodeEncoding format = barcode.BarcodeType;
            byte[] binaryData = barcode.BinaryValue;

            // Extract barcode image if needed
            System.Drawing.Bitmap barcodeImage = barcode.BarcodeImage;

            Console.WriteLine($"Found {format} on page {pageNumber}: {value}");
        }
    }
    else
    {
        Console.WriteLine("No barcodes found in the PDF.");
    }
}
catch (Exception ex)
{
    Console.WriteLine($"Error reading PDF: {ex.Message}");
}
Imports System
Imports IronBarCode

Try
	' Scan all pages of a PDF for barcodes
	Dim results As BarcodeResults = BarcodeReader.ReadPdf("MultipleBarcodes.pdf")

	If results IsNot Nothing AndAlso results.Count > 0 Then
		For Each barcode In results
			' Access barcode data and metadata
			Dim value As String = barcode.Text
			Dim pageNumber As Integer = barcode.PageNumber
			Dim format As BarcodeEncoding = barcode.BarcodeType
			Dim binaryData() As Byte = barcode.BinaryValue

			' Extract barcode image if needed
			Dim barcodeImage As System.Drawing.Bitmap = barcode.BarcodeImage

			Console.WriteLine($"Found {format} on page {pageNumber}: {value}")
		Next barcode
	Else
		Console.WriteLine("No barcodes found in the PDF.")
	End If
Catch ex As Exception
	Console.WriteLine($"Error reading PDF: {ex.Message}")
End Try
$vbLabelText   $csharpLabel

PDF sayfalarında algılanan birden fazla barkod konsol çıktısını gösteriyor Farklı PDF sayfalarında bulunan birden fazla barkodu gösteren konsol çıktısı

Belirli sayfa aralıkları veya gelişmiş PDF işlemleri için BarcodeReaderOptions kullanın:

// Read only specific pages to improve performance
BarcodeReaderOptions pdfOptions = new BarcodeReaderOptions
{
    // Scan pages 1-5 only
    PageNumbers = new[] { 1, 2, 3, 4, 5 },

    // PDF-specific settings
    PdfDpi = 300, // Higher DPI for better accuracy
    ReadBehindVectorGraphics = true
};

BarcodeResults results = BarcodeReader.ReadPdf("document.pdf", pdfOptions);
// Read only specific pages to improve performance
BarcodeReaderOptions pdfOptions = new BarcodeReaderOptions
{
    // Scan pages 1-5 only
    PageNumbers = new[] { 1, 2, 3, 4, 5 },

    // PDF-specific settings
    PdfDpi = 300, // Higher DPI for better accuracy
    ReadBehindVectorGraphics = true
};

BarcodeResults results = BarcodeReader.ReadPdf("document.pdf", pdfOptions);
' Read only specific pages to improve performance
Dim pdfOptions As New BarcodeReaderOptions With {
	.PageNumbers = { 1, 2, 3, 4, 5 },
	.PdfDpi = 300,
	.ReadBehindVectorGraphics = True
}

Dim results As BarcodeResults = BarcodeReader.ReadPdf("document.pdf", pdfOptions)
$vbLabelText   $csharpLabel

Çoklu çerçeve TIFF görüntülerini nasıl işleyebilirim?

Belge tarama ve faks sistemlerinde yaygın olan çoklu çerçeve TIFF dosyaları, PDF'lerle aynı kapsamlı desteği alır.

Çerçeveler arasında birden fazla barkod içeren çoklu çerçeve TIFF Farklı çerçeveler üzerinde barkodlar içeren bir çoklu çerçeve TIFF dosyası

using IronBarCode;

// TIFF files are processed similarly to regular images
// Each frame is scanned automatically
BarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");

foreach (var result in multiFrameResults)
{
    // Access frame-specific information
    int frameNumber = result.PageNumber; // Frame number in TIFF
    string barcodeValue = result.Text;

    Console.WriteLine($"Frame {frameNumber}: {barcodeValue}");

    // Save individual barcode images if needed
    result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png");
}
using IronBarCode;

// TIFF files are processed similarly to regular images
// Each frame is scanned automatically
BarcodeResults multiFrameResults = BarcodeReader.Read("Multiframe.tiff");

foreach (var result in multiFrameResults)
{
    // Access frame-specific information
    int frameNumber = result.PageNumber; // Frame number in TIFF
    string barcodeValue = result.Text;

    Console.WriteLine($"Frame {frameNumber}: {barcodeValue}");

    // Save individual barcode images if needed
    result.BarcodeImage?.Save($"barcode_frame_{frameNumber}.png");
}
Imports IronBarCode

' TIFF files are processed similarly to regular images
' Each frame is scanned automatically
Private multiFrameResults As BarcodeResults = BarcodeReader.Read("Multiframe.tiff")

For Each result In multiFrameResults
	' Access frame-specific information
	Dim frameNumber As Integer = result.PageNumber ' Frame number in TIFF
	Dim barcodeValue As String = result.Text

	Console.WriteLine($"Frame {frameNumber}: {barcodeValue}")

	' Save individual barcode images if needed
	If result.BarcodeImage IsNot Nothing Then
		result.BarcodeImage.Save($"barcode_frame_{frameNumber}.png")
	End If
Next result
$vbLabelText   $csharpLabel

Aynı BarcodeReaderOptions, görüntü filtreleri ve döndürme ayarları dahil olmak üzere TIFF işlemeye uygulanır. Ayrıntılı TIFF işleme senaryoları için görüntü işleme eğitimlerimize bakın.

Çoklu işlemeyle hızı artırabilirim mi?

Birden fazla belgeyi işlemek, paralel işlemden büyük ölçüde faydalanır. IronBarcode, optimal performans için mevcut CPU çekirdeklerini otomatik olarak kullanır.

using IronBarCode;

// List of documents to process - mix of formats supported
var documentBatch = new[] 
{ 
    "invoice1.pdf", 
    "shipping_label.png", 
    "inventory_sheet.tiff",
    "product_catalog.pdf"
};

// Configure for batch processing
BarcodeReaderOptions batchOptions = new BarcodeReaderOptions
{
    // Enable parallel processing across documents
    Multithreaded = true,

    // Limit threads if needed (0 = use all cores)
    MaxParallelThreads = Environment.ProcessorCount,

    // Apply consistent settings to all documents
    Speed = ReadingSpeed.Balanced,
    ExpectBarcodeTypes = BarcodeEncoding.All
};

// Process all documents in parallel
BarcodeResults batchResults = BarcodeReader.Read(documentBatch, batchOptions);

// Group results by source document
var resultsByDocument = batchResults.GroupBy(r => r.Filename);

foreach (var docGroup in resultsByDocument)
{
    Console.WriteLine($"\nDocument: {docGroup.Key}");
    foreach (var barcode in docGroup)
    {
        Console.WriteLine($"  - {barcode.BarcodeType}: {barcode.Text}");
    }
}
using IronBarCode;

// List of documents to process - mix of formats supported
var documentBatch = new[] 
{ 
    "invoice1.pdf", 
    "shipping_label.png", 
    "inventory_sheet.tiff",
    "product_catalog.pdf"
};

// Configure for batch processing
BarcodeReaderOptions batchOptions = new BarcodeReaderOptions
{
    // Enable parallel processing across documents
    Multithreaded = true,

    // Limit threads if needed (0 = use all cores)
    MaxParallelThreads = Environment.ProcessorCount,

    // Apply consistent settings to all documents
    Speed = ReadingSpeed.Balanced,
    ExpectBarcodeTypes = BarcodeEncoding.All
};

// Process all documents in parallel
BarcodeResults batchResults = BarcodeReader.Read(documentBatch, batchOptions);

// Group results by source document
var resultsByDocument = batchResults.GroupBy(r => r.Filename);

foreach (var docGroup in resultsByDocument)
{
    Console.WriteLine($"\nDocument: {docGroup.Key}");
    foreach (var barcode in docGroup)
    {
        Console.WriteLine($"  - {barcode.BarcodeType}: {barcode.Text}");
    }
}
Imports Microsoft.VisualBasic
Imports IronBarCode

' List of documents to process - mix of formats supported
Private documentBatch = { "invoice1.pdf", "shipping_label.png", "inventory_sheet.tiff", "product_catalog.pdf" }

' Configure for batch processing
Private batchOptions As New BarcodeReaderOptions With {
	.Multithreaded = True,
	.MaxParallelThreads = Environment.ProcessorCount,
	.Speed = ReadingSpeed.Balanced,
	.ExpectBarcodeTypes = BarcodeEncoding.All
}

' Process all documents in parallel
Private batchResults As BarcodeResults = BarcodeReader.Read(documentBatch, batchOptions)

' Group results by source document
Private resultsByDocument = batchResults.GroupBy(Function(r) r.Filename)

For Each docGroup In resultsByDocument
	Console.WriteLine($vbLf & "Document: {docGroup.Key}")
	For Each barcode In docGroup
		Console.WriteLine($"  - {barcode.BarcodeType}: {barcode.Text}")
	Next barcode
Next docGroup
$vbLabelText   $csharpLabel

Bu paralel yaklaşım, belgeleri aynı anda işleyerek çoklu çekirdek sistemlerde toplam tarama süresini %75'e kadar azaltır. Kurumsal ölçekli barkod işleme için performans optimizasyon kılavuzumuzu inceleyin.

Özet

IronBarcode, karmaşık barkod taramayı basit C# koduna dönüştürür. İster envanter sistemleri, ister belge işlemciler veya mobil uygulamalar oluşturuyor olun, kütüphane mükemmel dijital barkodlardan zorlu gerçek dünya çekimlerine kadar her şeyi yönetir.

Kapsanan anahtar yetenekler:

  • Görüntülerden tek satırlı barkod okuma
  • Hasarlı veya döner barkodlar için gelişmiş seçenekler
  • Kapsamlı PDF ve TIFF belge tarama
  • Çoklu işlemedeki yüksek performanslı toplu işleme
  • Tüm ana barkod formatları için destek

Daha Fazla Okuma

Barkod işleme yeteneklerinizi bu kaynaklarla genişletin:

Kaynak Kod İndir

Bu örnekleri kendiniz çalıştırın:

Uygulamanızda barkod taramayı uygulamaya hazır mısınız? Ücretsiz denemenize başlayın ve profesyonel barkod okuma ekleyin .NET projenize bugün.

Şimdi IronBarcode ile başlayın.
green arrow pointer

Sıkça Sorulan Sorular

.NET projesine bir barkod okuma kütüphanesini nasıl kurabilirim?

IronBarcode kütüphanesini, NuGet Paket Yöneticisi aracılığıyla dotnet add package BarCode komutu kullanarak veya Visual Studio'nun NuGet arayüzünden kurabilirsiniz. Alternatif olarak, manuel yükleme için DLL'yi indirin.

C# kullanarak bir görüntüden barkod okumanın yöntemi nedir?

IronBarcode'dan BarcodeReader.Read yöntemini tek bir kod satırında kullanın: var results = BarcodeReader.Read('image.png'); Bu yöntem, görüntüde bulunan tüm barkod formatlarını algılar ve okur.

Tek bir görüntü veya belgede birden fazla barkodu algılamak mümkün müdür?

Evet, IronBarcode, bir görüntüde, PDF'te veya çok çerçeveli TIFF'te birden fazla barkodu otomatik olarak algılayabilir ve okuyabilir; her barkodun değerini, tipini ve pozisyonunu BarcodeResults koleksiyonunda döndürür.

C# kullanarak bir PDF'den barkodları nasıl okurum?

IronBarcode'un BarcodeReader.ReadPdf yöntemini kullanarak bir PDF belgesinin tüm sayfalarını tarayın: var results = BarcodeReader.ReadPdf('document.pdf'); Her sonuç, barkodun bulunduğu sayfa numarasını içermektedir.

Barkod görüntüleri bulanık veya döndürülmüşse ne yapmalıyım?

Zorlu görüntüleri ele almak için, BarcodeReaderOptions yapılandırmasını AutoRotate = true olarak ayarlayın ve SharpenFilter veya AdaptiveThresholdFilter gibi görüntü filtrelerini uygulayın. Daha iyi doğruluk için Speed = ExtremeDetail kullanın.

.NET uygulamalarında hangi barkod formatları desteklenmektedir?

IronBarcode, QR Kod, Code 128, Code 39, EAN-13, UPC-A, Data Matrix, PDF417 ve daha fazlası gibi tüm ana barkod formatlarını destekler. Desteklenen herhangi bir formatı taramak için BarcodeEncoding.All'u kullanın.

C# uygulamasında barkod tarama performansını nasıl artırabilirim?

Özbeklenen barkod türlerini ExpectBarcodeTypes ile belirterek, Çoklu iş parçacığı işlemi etkinleştirerek ve uygun Speed ayarlarını seçerek performansı artırın. Toplu işler için, dosya yolları ile BarcodeReader.Read kullanın.

Barkod okuma hatalarını ele almak için önerilen yaklaşım nedir?

Barkod okuma işlemini try-catch blokları içine alın ve sonuçların null veya boş olup olmadığını kontrol edin. IronBarcode, algılama güvenilirliğini gösteren Ayrıntılı hata mesajları ve Confidence özelliği sağlar.

Barkodlar tarandıktan sonra barkod görüntülerini çıkarabilir miyim?

Evet, IronBarcode'un BarcodeResult sınıfı, algılanan barkodun bir Bitmap içeren BarcodeImage özelliğini içerir, bu da kaydedilebilir veya ayrı bir şekilde işlenebilir.

Bir PDF belgesinin belirli sayfalarından barkodları nasıl okuyabilirim?

BarcodeReaderOptions içindeki PageNumbers özelliğini sayfaları belirlemek için ayarlayın: options.PageNumbers = new[] {1, 2, 3}; Bu, yalnızca belirlenen sayfaların taranmasıyla performansı optimize eder.

.NET'te barkod tarama ile uyumlu olan görüntü formatları nelerdir?

IronBarcode, PNG, JPEG, BMP, GIF, TIFF (çoklu çerçeve dahil) ve PDF gibi formatlarda taramayı destekler. Görselleri dosya yollarından, akışlardan veya bayt dizilerinden yükleyebilirsiniz.

C#'da taranmış barkodlardan ikili verilere nasıl erişebilirim?

Özellikle sıkıştırılmış bilgileri veya ikili protokoller gibi metin dışı veriler içeren barkodlar için BinaryValue özelliğini kullanarak BarcodeResult üzerinde ham ikili verileri elde edin.

Jacob Mellor, Teknoloji Direktörü @ Team Iron
Chief Technology Officer

Jacob Mellor, Iron Software'in Teknoloji Müdürü ve C# PDF teknolojisinin öncüsü olan vizyoner bir mühendis. Iron Software’in temel kod tabanının ilk geliştiricisi olarak, şirketin ürün mimarisini kuruluşundan bu yana şekillendirdi ve CEO Cameron Rimington ile birlikte NASA, Tesla ve ...

Daha Fazlasını Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 2,169,908 | Sürüm: 2026.4 just released
Still Scrolling Icon

Hala Kaydiriyor musunuz?

Hızlı bir kanit mi istiyorsunuz? PM > Install-Package BarCode
bir örnek çalıştırın dize barkod haline geldiğini görün.