Olc.BarcodeScanner 3.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Olc.BarcodeScanner --version 3.0.0
                    
NuGet\Install-Package Olc.BarcodeScanner -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Olc.BarcodeScanner" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Olc.BarcodeScanner" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Olc.BarcodeScanner" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Olc.BarcodeScanner --version 3.0.0
                    
#r "nuget: Olc.BarcodeScanner, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Olc.BarcodeScanner@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Olc.BarcodeScanner&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Olc.BarcodeScanner&version=3.0.0
                    
Install as a Cake Tool

Olc.BarcodeScanner

A comprehensive barcode scanning library for .NET applications, providing robust and reliable barcode detection and decoding capabilities.

Overview

Olc.BarcodeScanner is a high-performance barcode scanning solution designed for .NET developers. It supports multiple barcode formats and provides seamless integration with various .NET platforms including .NET Framework, .NET Core, and .NET 5+.

Features

  • Multi-format Support: Compatible with major barcode formats including QR Code, Code 128, Code 39, EAN-13, EAN-8, UPC-A, UPC-E, and more
  • High Performance: Optimized scanning algorithms for fast and accurate barcode detection
  • Cross-Platform: Works across Windows, Linux, and macOS
  • Easy Integration: Simple API design for quick implementation
  • Customizable: Configurable scanning parameters and result handling
  • Reliable: Robust error handling and fallback mechanisms

Supported Platforms

  • .NET Framework 4.6.1+
  • .NET Core 2.0+
  • .NET 5.0+
  • Xamarin.iOS
  • Xamarin.Android
  • .NET MAUI

Installation

Install via NuGet Package Manager:

Install-Package Olc.BarcodeScanner

Or via .NET CLI:

dotnet add package Olc.BarcodeScanner

Quick Start

using Olc.BarcodeScanner;

// Create scanner instance
var scanner = new BarcodeScanner();

// Scan from image file
var result = scanner.ScanFromFile("path/to/image.jpg");
if (result != null)
{
    Console.WriteLine($"Barcode: {result.Text}");
    Console.WriteLine($"Format: {result.Format}");
}

// Scan from bitmap
using var bitmap = new Bitmap("image.jpg");
var scanResult = scanner.ScanFromBitmap(bitmap);

Basic Usage

Scanning from File

var scanner = new BarcodeScanner();
var result = scanner.ScanFromFile("barcode.jpg");
if (result != null)
{
    Console.WriteLine($"Detected: {result.Text}");
}

Scanning from Stream

using var stream = File.OpenRead("image.png");
var scanner = new BarcodeScanner();
var result = scanner.ScanFromStream(stream);

Configuring Scanner

var scanner = new BarcodeScanner
{
    // Enable specific barcode formats
    SupportedFormats = new[] { BarcodeFormat.QRCode, BarcodeFormat.Code128 },
    
    // Set confidence threshold
    ConfidenceThreshold = 0.8,
    
    // Enable multiple barcode detection
    EnableMultiScan = true
};

Advanced Configuration

Custom Scanning Options

var options = new ScanOptions
{
    Formats = new[] { BarcodeFormat.QRCode, BarcodeFormat.Code39 },
    InvertColors = false,
    RotateImage = true,
    CropRegion = new Rectangle(0, 0, 800, 600)
};

var result = scanner.ScanWithOptions("image.jpg", options);

Error Handling

try
{
    var result = scanner.ScanFromFile("image.jpg");
    if (result == null)
    {
        Console.WriteLine("No barcode detected.");
    }
}
catch (BarcodeException ex)
{
    Console.WriteLine($"Scanning error: {ex.Message}");
}

Performance Tips

  1. Image Optimization: Resize images to reasonable dimensions (800x600 to 1920x1080) for best performance
  2. Format Filtering: Specify supported formats to improve scanning speed
  3. Quality Settings: Use high-contrast images for better recognition accuracy
  4. Memory Management: Dispose scanner instances when no longer needed

API Reference

Classes

  • BarcodeScanner: Main scanning class
  • ScanResult: Contains detected barcode information
  • ScanOptions: Configuration options for scanning
  • BarcodeFormat: Supported barcode format enumeration

Methods

  • ScanFromFile(string path): Scan from image file
  • ScanFromStream(Stream stream): Scan from stream
  • ScanFromBitmap(Bitmap bitmap): Scan from bitmap
  • ScanWithOptions(string path, ScanOptions options): Scan with custom options

Troubleshooting

Common Issues

  1. No barcode detected: Ensure image quality is sufficient and barcode is clearly visible
  2. Poor recognition: Try adjusting image contrast, brightness, or resolution
  3. Performance issues: Use format filtering and optimize image size
  4. Memory usage: Properly dispose scanner instances and large images

Debug Mode

Enable debug logging to troubleshoot scanning issues:

scanner.EnableDebugLogging = true;
scanner.ScanFromFile("image.jpg");

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

Support

For support and questions:

Version History

3.0.0 (November 25, 2025)

  • Enhanced barcode recognition accuracy
  • Improved performance for large images
  • Added support for new barcode formats
  • Updated API for better usability
  • Bug fixes and stability improvements

Previous Versions

  • 2.2.0: Added .NET MAUI support
  • 2.1.0: Performance optimizations
  • 2.0.0: Major API redesign
  • 1.0.0: Initial release

About itos

itos is a leading provider of enterprise software solutions, specializing in barcode and scanning technologies for business applications.


Copyright (c) 2025 itos. All rights reserved.

Product Compatible and additional computed target framework versions.
MonoAndroid monoandroid11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated