Olc.BarcodeScanner
3.0.0
dotnet add package Olc.BarcodeScanner --version 3.0.0
NuGet\Install-Package Olc.BarcodeScanner -Version 3.0.0
<PackageReference Include="Olc.BarcodeScanner" Version="3.0.0" />
<PackageVersion Include="Olc.BarcodeScanner" Version="3.0.0" />
<PackageReference Include="Olc.BarcodeScanner" />
paket add Olc.BarcodeScanner --version 3.0.0
#r "nuget: Olc.BarcodeScanner, 3.0.0"
#:package Olc.BarcodeScanner@3.0.0
#addin nuget:?package=Olc.BarcodeScanner&version=3.0.0
#tool nuget:?package=Olc.BarcodeScanner&version=3.0.0
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
- Image Optimization: Resize images to reasonable dimensions (800x600 to 1920x1080) for best performance
- Format Filtering: Specify supported formats to improve scanning speed
- Quality Settings: Use high-contrast images for better recognition accuracy
- Memory Management: Dispose scanner instances when no longer needed
API Reference
Classes
BarcodeScanner: Main scanning classScanResult: Contains detected barcode informationScanOptions: Configuration options for scanningBarcodeFormat: Supported barcode format enumeration
Methods
ScanFromFile(string path): Scan from image fileScanFromStream(Stream stream): Scan from streamScanFromBitmap(Bitmap bitmap): Scan from bitmapScanWithOptions(string path, ScanOptions options): Scan with custom options
Troubleshooting
Common Issues
- No barcode detected: Ensure image quality is sufficient and barcode is clearly visible
- Poor recognition: Try adjusting image contrast, brightness, or resolution
- Performance issues: Use format filtering and optimize image size
- 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:
- Create an issue in our GitHub repository
- Contact: support@itos.com
- Documentation: https://docs.itos.com/barcode-scanner
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| MonoAndroid | monoandroid11.0 is compatible. |
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 |
|---|