C#'ta Barkodlar Nasıl Okunur

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 BARCODE'ları veya QR kodlarını hızlı bir şekilde taramanız mı gerekiyor? IronBarcode, ister kusursuz dijital görüntüler ister zorlu gerçek dünya fotoğrafları işliyor olun, BARCODE okuma işlemini basit ve güvenilir hale getirir. Bu kılavuz, hemen kullanabileceğiniz pratik örneklerle C#'da BarCode taramayı nasıl uygulayacağınızı tam olarak gösterir.

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

Bu kısa örnek, IronBarcode'u kullanmaya başlamanın ne kadar kolay olduğunu gösterir. Sadece tek bir kod satırıyla, karmaşık bir kurulum gerektirmeden bir görüntü dosyasından BARCODE'ları okuyabilirsiniz.

  1. IronBarcode aşağıdaki NuGet Paket Yöneticisi ile yükleyin

    PM > Install-Package BarCode
  2. Bu kod parçacığını kopyalayın ve çalıştırın.

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

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

    arrow pointer

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

IronBarcode, NuGet Paket Yöneticisi aracılığıyla veya DLL dosyasını doğrudan indirerek kolayca kurulabilir. NuGet kurulumu, bağımlılıkları ve güncellemeleri otomatik olarak yönettiği için önerilen yaklaşımdır.

Install-Package BarCode

Kurulumdan sonra, BARCODE tarama işlevine erişmek için C# dosyalarınıza using IronBarCode; ekleyin. Farklı geliştirme ortamlarına yönelik ayrıntılı kurulum talimatları için kurulum kılavuzumuza bakın.

C# kullanarak ilk BarCode'umu nasıl okuyabilirim?

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

Code128 barcode ready for scanning - contains text 'https://ironsoftware.com/csharp/barcode/' *IronBarcode'un anında okuyabildiği standart bir Code128 BARCODE*
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.Co/unt > 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.Co/nfidence - 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.Co/unt > 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.Co/nfidence - 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 yöntemi, algılanan tüm BARCODE'leri içeren bir BarcodeResults koleksiyonu döndürür. Her bir BarcodeResult, BARCODE'un metin değerine, format türüne, konum koordinatlarına ve ikili verilere erişim sağlar. Bu yaklaşım, Code128, Code39, QR kodları ve Data Matrix kodları dahil olmak üzere yaygın BARCODE formatlarıyla sorunsuz bir şekilde çalışır.

Zor veya hasarlı BARCODE'ları okumaya yardımcı olan seçenekler nelerdir?

Gerçek hayatta BARCODE tarama işlemi genellikle kusurlu görüntülerle (eğri açılar, yetersiz aydınlatma veya kısmi hasar) karşılaşır. IronBarcode'un gelişmiş seçenekleri bu zorlukları etkili bir şekilde aşar.

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.Co/de128,

    // 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.Co/de128,

    // 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
Dim options As New BarcodeReaderOptions With {
    ' 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 Or BarcodeEncoding.Code128,

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

    ' Crop region for faster processing of specific areas
    .CropArea = Nothing ' Or specify a Rectangle
}

' Apply options when reading
Dim 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 *IronBarcode'un gelişmiş seçenekleri kullanarak başarıyla okuduğu döndürülmüş bir QR kodu*

ExpectBarcodeTypes özelliği, aramayı belirli biçimlerle sınırlayarak performansı önemli ölçüde artırır. Sorunlu görüntülerde maksimum doğruluk için, görüntü filtrelerini otomatik döndürme ile 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.Co/nfidence}%");
    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.Co/nfidence}%");
    Console.WriteLine($"Position: X={result.X}, Y={result.Y}");
}
Imports IronBarCode

Dim options As New BarcodeReaderOptions With {
    .ImageFilters = New ImageFilterCollection From {
        New AdaptiveThresholdFilter(9, 0.01F), ' Handles varying lighting
        New ContrastFilter(2.0F),               ' Increases contrast
        New SharpenFilter()                     ' Reduces blur
    },
    .AutoRotate = True,                         ' Automatically rotate to find barcodes at any angle
    .Multithreaded = True                       ' Use multiple CPU cores for faster processing
}

Dim 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
$vbLabelText   $csharpLabel

Bu gelişmiş özellikler, IronBarcode'u görüntü kalitesinin önemli ölçüde değişkenlik gösterdiği fotoğraflar, güvenlik kameraları veya mobil cihaz yakalamalarından BARCODE taraması için ideal hale getirir.

PDF belgelerinden birden fazla BarCode'u nasıl tarayabilirim?

PDF BARCODE taraması, faturaların, sevk etiketlerinin ve envanter belgelerinin işlenmesi için gereklidir. IronBarcode, her sayfadaki tüm BarCode'ları verimli bir şekilde okur.

PDF dosyalarından BarCode okuma

using System;
using IronBarCode;

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

    if (results != null && results.Co/unt > 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.Co/unt > 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
    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

Konsol çıktısını gösteren PDF sayfalarında birden fazla BarCode algılandı Farklı PDF sayfalarında bulunan birden fazla BARCODE'u gösteren konsol çıktısı

Belirli sayfa aralıkları veya gelişmiş PDF işleme 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

Çok kareli TIFF görüntülerini nasıl işleyebilirim?

Belge tarama ve faks sistemlerinde yaygın olarak kullanılan çok çerçeveli TIFF dosyaları, PDF'ler ile aynı kapsamlı desteği alır.

Çerçeveler arasında birden fazla BarCode içeren çoklu çerçeve TIFF dosyası Farklı karelerde BarCode bulunan çok kareli bir 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şleme için de geçerlidir. Ayrıntılı TIFF işleme senaryoları için görüntü işleme eğitimlerimize bakın.

Çoklu iş parçacığı kullanarak işlemeyi hızlandırabilir miyim?

Birden fazla belgenin işlenmesi, paralel işlemeden büyük ölçüde yararlanır. IronBarcode, optimum 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 eşzamanlı olarak işleyerek çok çekirdekli sistemlerde toplam tarama süresini %75'e kadar azaltır. Kurumsal ölçekte BarCode işleme için performans optimizasyon kılavuzumuzu inceleyin.

Özet

IronBarcode, karmaşık BarCode taramayı basit C# koduna dönüştürür. İster envanter sistemleri, ister belge işleyiciler veya mobil uygulamalar geliştiriyor olun, bu kütüphane kusursuz dijital BarCode'lardan zorlu gerçek dünya yakalamalarına kadar her şeyi halleder.

Kapsanan temel özellikler:

  • Görüntülerden tek satırlık BarCode okuma
  • Hasarlı veya döndürülmüş BARCODE'lar için gelişmiş seçenekler
  • Kapsamlı PDF ve TIFF belge tarama
  • Çoklu iş parçacığı ile yüksek performanslı toplu işleme
  • Tüm önemli BarCode formatlarını destekler

Daha Fazla Bilgi

Bu kaynaklarla BarCode işleme yeteneklerinizi genişletin:

Kaynak Kodu İndirmeleri

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

Uygulamanıza BarCode tarama özelliğini eklemeye hazır mısınız? Ücretsiz deneme sürenizi başlatın ve .NET projenize bugün Professional Barkod Okuma özelliğini ekleyin.

Ş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 komutunu kullanarak veya Visual Studio'nun NuGet arayüzünden kurabilirsiniz. Alternatif olarak, DLL'i manuel kurulum için indiriniz.

C# kullanarak bir görüntüden barkod nasıl okunur?

IronBarcode'dan BarcodeReader.Read yöntemini tek satırlık bir kodla 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 barkod tespit etmek mümkün mü?

Evet, IronBarcode, bir görüntüde, PDF'de veya çok çerçeveli TIFF'de birden fazla barkodu otomatik olarak tespit edebilir ve okuyabilir, her bir barkodun değerini, türünü ve konumunu BarcodeResults koleksiyonunda döndürebilir.

C# kullanarak PDF'den barkodlar nasıl okunur?

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

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

Zorlu görüntülerle başa çıkmak için BarcodeReaderOptions'i AutoRotate = true olarak ayarlayarak yapılandırı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 Code, Code 128, Code 39, EAN-13, UPC-A, Data Matrix, PDF417 ve daha birçok büyük barkod formatını destekler. Herhangi bir desteklenen formatı taramak için BarcodeEncoding.All kullanın.

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

Beklenen barkod türlerini ExpectBarcodeTypes ile belirterek, Çoklu iş parçacıklı işlemi etkinleştirerek ve uygun Speed ayarlarını seçerek performansı artırın. Toplu görevler için, dosya yollarıyla BarcodeReader.Read kullanın.

Barkod okuma hatalarıyla başa çıkmanın önerilen yaklaşımı nedir?

Barkod okumalarını try-catch bloklarında kapsayın ve sonuçların boş olup olmadığını kontrol edin. IronBarcode ayrıntılı hata mesajları ve tespit güvenilirliğini gösteren Confidence özelliği sağlar.

Taramadan sonra barkod görüntülerini çıkarabilir miyim?

Evet, IronBarcode'un BarcodeResult, tespit edilen barkodun Bitmap içeren bir BarcodeImage özelliğine sahiptir ve bu, ayrı kaydedilebilir veya işlenebilir.

PDF belgesinin belirli sayfalarından barkodlar nasıl okunur?

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

.NET'de barkod tarama için hangi görüntü formatları uyumludur?

IronBarcode, PNG, JPEG, BMP, GIF, TIFF (çok çerçeveler dahil) ve PDF formatlarında taramayı destekler. Dosya yollarından, akışlardan veya bayt dizilerinden görüntü yükleyebilirsiniz.

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

Çiğ ikili veri elde etmek için BarcodeResult'un BinaryValue özelliğini kullanın, bu özellik özellikle sıkıştırılmış bilgiler veya ikili protokoller içeren barkodlar için kullanışlıdır.

Jacob Mellor, Teknoloji Direktörü @ Team Iron
Teknoloji Direktörü

Jacob Mellor, Iron Software'de Baş Teknoloji Yöneticisidir ve C# PDF teknolojisinde öncü bir mühendisdir. Iron Software'ın ana kod tabanının ilk geliştiricisi olarak, CEO Cameron Rimington ile birlikte şirketin ürün mimarisini 50'den fazla kişilik bir şirkete dönüştürmüştür ...

Daha Fazla Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 2,240,258 | Sürüm: 2026.5 just released
Still Scrolling Icon

Hâlâ Kaydırıyor Musunuz?

Hızlıca kanıt ister misiniz? PM > Install-Package BarCode
bir örnek çalıştır dizginizin barkoda dönüştüğünü izle.