IronBarcode ve ZXing.NET Arasında Bir Karşılaştırma
Barkod tarayıcı her zaman uygulamalarımız için uygun olmayabilir. Zaten barkodun dijital bir görüntüsüne sahip olabilirsiniz ve bunun İngilizce metinde neyi temsil ettiğini bilmek isteyebilirsiniz. Ayrıca, bu tarayıcı yalnızca sınırlı miktarda veri içeren ve yalnızca Windows RT Class kütüphanesinde kullanılabilen 1D barkodları okumaktadır. 2D barkodlar (aynı zamanda QR kodları olarak bilinir) artık yaygındır ve çok daha fazla bilgi içerebilir.
C# tabanlı bir uygulama, basit API çağrıları ve birkaç kod yazım adımı kullanarak barkodları okumak için oluşturulabilir. .NET destekli bir uygulama, herhangi bir üçüncü taraf araç veya API kullanmadan Windows, macOS veya Linux'ta çalışır.
Bu makale, barkodları programatik olarak okumak için iki en güçlü .NET Core uygulama kütüphanesini karşılaştıracaktır. Bu iki kütüphane IronBarcode ve ZXing.NET'tir. IronBarcode'u ZXing.NET'ten daha güçlü ve sağlam yapan şeyleri göreceğiz.
Zxing kullanarak C# ile Barkod Nasıl Oluşturulur
- Barkod oluşturmak için C# kütüphanesi yükleyin
BarcodeWriterPixelDatasınıfından yeni bir nesne oluşturarak barkodu özelleştirinFormatözelliği ile barkod türünü ayarlayınQrCodeEncodingOptionssınıfının bir örneğini oluşturarak Yükseklik, Genişlik ve kenar boşluklarını daha fazla özelleştirin- 2. adımda nesnenin
Writeyöntemini kullanarak C# ile barkod oluşturun
ZXing.NET Nedir?
ZXing.NET, barkodları (QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar gibi) çözen ve üreten bir kütüphanedir. Zebra crossing anlamına gelen ZXing, çeşitli 1D ve 2D barkod formatlarını destekleyen, Java tabanlı, açık kaynaklı bir kütüphanedir.
Temel özellikleri aşağıdaki gibidir:
- URL'leri, iletişim bilgilerini, takvim olaylarını ve daha fazlasını saklama yeteneği vardır
- Java SE uygulamaları için özelleştirilmiştir
- Barkod tarayıcı entegrasyonunu intent ile sağlar
- Basit bir Google Glass uygulamasıdır
IronBarcode nedir?
IronBarcode, programcıların barkod okumalarını ve üretmelerini sağlayan bir C# kütüphanesidir. Lider bir barkod kütüphanesi olarak IronBarcode, dekore edilmiş (renkli ve markalı) QR kodlar da dahil olmak üzere geniş bir 1D ve 2D barkod yelpazesini destekler. .NET Standard ve Core Sürümleri 2 ve daha yüksek sürümleri destekler ve böylece Azure, Linux, macOS, Windows ve Web üzerinde çapraz platform kullanımı sağlar. IronBarcode, C#, VB.NET ve F# geliştiricilerinin standartlaştırılmış programlama dilleriyle çalışmasına olanak tanıyan .NET sistemi için bilinen bir sınıf kütüphanesi veya bileşendir. Müşterilerin tarayıcı etiketlerini incelemelerine ve yeni standart etiketler oluşturmalarına olanak tanır. 2D barkodlar ve diğer 3D standartlaştırılmış barkodlarla oldukça iyi çalışır.
IronBarcode artık 2D barkodları desteklemektedir. Bu kodların renklendirilmesi, stillendirilmesi ve pikselasyonu için özelleştirme işlevselliği sağlayarak baskıda veya reklam materyalinde kullanım için logo ekleme olanağı sunar. Bu kütüphane ayrıca diğer barkod yazılımlarının okuyamayabileceği eğri ve deforme barkodları okuyabilir.
IronBarcode ve ZXing.NET Yükleme
ZXing.NET Yükleme
ZXing.NET kütüphanesini kullanmak için, aşağıdaki iki paketi ASP.NET Core uygulamanıza NuGet Package Manager Console kullanarak yükleyin:
1. ZXing.Net
Install-Package ZXing.Net
2. ZXing.Net.Bindings.CoreCompat.System.Drawing
Install-Package ZXing.Net.Bindings.CoreCompat.System.Drawing -Version 0.16.5-beta
Alternatif olarak, NuGet Package Manager kullanarak projenize ZXing.NET yükleyin. Araçlar > NuGet Package Manager > NuGet çözümleri için paketleri yönet...'e gidin, ardından "Gezint" sekmesine geçin ve "ZXing.NET" arayın.
ASP.NET Web Uygulaması
IronBarcode Yükleme
IronBarcode, NuGet Package Manager kullanılarak veya ürün web sitesinden doğrudan DLL indirerek yüklenebilir. IronBarcode ad alanı, tüm IronBarcode sınıflarını içermektedir.
IronBarcode, Visual Studio için NuGet Package Manager kullanılarak yüklenebilir: paket adı "Barcode".
Install-Package BarCode
2D Barkod Yaratma
ZXing.NET Kullanarak
Öncelikle proje dosyasının kök klasörünün içinde 'qrr' adında yeni bir klasör oluşturun.
Daha sonra QR dosyalarını oluşturup, görüntü sistem dosyalarını 'qrr' klasörüne depolayacağız.
Kontrolcü içinde, aşağıda kaynak kodda gösterildiği gibi GenerateFile() yöntemini ekleyin.
public ActionResult GenerateFile()
{
return View();
}
[HttpPost]
public ActionResult GenerateFile(string qrText)
{
Byte [] byteArray;
var width = 250; // width of the QR Code
var height = 250; // height of the QR Code
var margin = 0;
// BarcodeWriterPixelData acts as a QR code generator
var qrCodeWriter = new ZXing.BarcodeWriterPixelData
{
Format = ZXing.BarcodeFormat.QR_CODE,
Options = new QrCodeEncodingOptions
{
Height = height,
Width = width,
Margin = margin
}
};
var pixelData = qrCodeWriter.Write(qrText);
// creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
{
using (var ms = new MemoryStream())
{
var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
try
{
// we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
}
finally
{
bitmap.UnlockBits(bitmapData);
}
// Save to folder
string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
// Save to stream as PNG
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
byteArray = ms.ToArray();
}
}
return View(byteArray);
}
public ActionResult GenerateFile()
{
return View();
}
[HttpPost]
public ActionResult GenerateFile(string qrText)
{
Byte [] byteArray;
var width = 250; // width of the QR Code
var height = 250; // height of the QR Code
var margin = 0;
// BarcodeWriterPixelData acts as a QR code generator
var qrCodeWriter = new ZXing.BarcodeWriterPixelData
{
Format = ZXing.BarcodeFormat.QR_CODE,
Options = new QrCodeEncodingOptions
{
Height = height,
Width = width,
Margin = margin
}
};
var pixelData = qrCodeWriter.Write(qrText);
// creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
using (var bitmap = new System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb))
{
using (var ms = new MemoryStream())
{
var bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
try
{
// we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
}
finally
{
bitmap.UnlockBits(bitmapData);
}
// Save to folder
string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
// Save to stream as PNG
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
byteArray = ms.ToArray();
}
}
return View(byteArray);
}
Public Function GenerateFile() As ActionResult
Return View()
End Function
<HttpPost>
Public Function GenerateFile(ByVal qrText As String) As ActionResult
Dim byteArray() As Byte
Dim width = 250 ' width of the QR Code
Dim height = 250 ' height of the QR Code
Dim margin = 0
' BarcodeWriterPixelData acts as a QR code generator
Dim qrCodeWriter = New ZXing.BarcodeWriterPixelData With {
.Format = ZXing.BarcodeFormat.QR_CODE,
.Options = New QrCodeEncodingOptions With {
.Height = height,
.Width = width,
.Margin = margin
}
}
Dim pixelData = qrCodeWriter.Write(qrText)
' creating a PNG bitmap from the raw pixel data; if only black and white colors are used it makes no difference if the raw pixel data is BGRA oriented and the bitmap is initialized with RGB
Using bitmap = New System.Drawing.Bitmap(pixelData.Width, pixelData.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb)
Using ms = New MemoryStream()
Dim bitmapData = bitmap.LockBits(New System.Drawing.Rectangle(0, 0, pixelData.Width, pixelData.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb)
Try
' we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length)
Finally
bitmap.UnlockBits(bitmapData)
End Try
' Save to folder
Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)
bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)
' Save to stream as PNG
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
byteArray = ms.ToArray()
End Using
End Using
Return View(byteArray)
End Function
Kalan tek değişiklik, QR kod dosyasını 'qrr' klasörüne kaydetmektir. Bu, aşağıdaki iki satır kod kullanılarak gerçekleştirilir.
string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
string fileGuid = Guid.NewGuid().ToString().Substring(0, 4);
bitmap.Save(Server.MapPath("~/qrr") + "/file-" + fileGuid + ".png", System.Drawing.Imaging.ImageFormat.Png);
Dim fileGuid As String = Guid.NewGuid().ToString().Substring(0, 4)
bitmap.Save(Server.MapPath("~/qrr") & "/file-" & fileGuid & ".png", System.Drawing.Imaging.ImageFormat.Png)
Sonrasında, GenerateFile görünümünü oluşturmalı ve içine aşağıdaki kodu eklemelisiniz. GenerateFile görünümü, Index görünümü ile aynıdır.
@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
<table>
<tbody>
<tr>
<td>
<label>Enter text for creating QR Code</label>
</td>
<td>
<input type="text" name="qrText" />
</td>
</tr>
<tr>
<td colspan="2">
<button>Submit</button>
</td>
</tr>
</tbody>
</table>
}
@{
if (Model != null)
{
<h3>QR Code Successfully Generated</h3>
<img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
}
}
@model Byte []
@using (Html.BeginForm(null, null, FormMethod.Post))
{
<table>
<tbody>
<tr>
<td>
<label>Enter text for creating QR Code</label>
</td>
<td>
<input type="text" name="qrText" />
</td>
</tr>
<tr>
<td colspan="2">
<button>Submit</button>
</td>
</tr>
</tbody>
</table>
}
@{
if (Model != null)
{
<h3>QR Code Successfully Generated</h3>
<img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model))" />
}
}
model Function [using](Html.BeginForm ByVal As (Nothing, Nothing, FormMethod.Post)) As Byte()
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan="2"> <button> Submit</button> </td> </tr> </tbody> </table>
"qrText" /> </td> </tr> (Of tr) <td colspan="2"> (Of button) Submit</button> </td> </tr> </tbody> </table>
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: <table> <tbody> <tr> <td> <label> Enter text for creating QR Code</label> </td> <td> <input type="text" name="qrText" /> </td> </tr> <tr> <td colspan
"text" name="qrText" /> </td> </tr> (Of tr) <td colspan
(Of table) (Of tbody) (Of tr) (Of td) (Of label) Enter text for creating QR Code</label> </td> (Of td) <input type="text" name
End Function
@
If True Then
If Model IsNot Nothing Then
'INSTANT VB WARNING: Instant VB cannot determine whether both operands of this division are integer types - if they are then you should use the VB integer division operator:
(Of h3) QR Code Successfully Generated</h3> <img src="@String.Format("data:image/png
base64,
If True Then
0
End If
", Convert.ToBase64String(Model))" />
End If
End If
Metin kutusuna herhangi bir değer girin ve 'Gönder' düğmesine tıklayın. QR Kodu oluşturulacak ve 'qrr' klasörüne bir .PNG dosyası olarak kaydedilecektir.
QR Kod Üretici
QR Kod Dosyaları Görüntülenmekte
Desteklenen Barkod Formatları
IronBarcode, yaygın olarak kullanılan çok çeşitli barkod formatlarını destekler, bunlar arasında:
- Logolar ve renklerle süslenmiş QR kodları (süslenmiş ve markalı kodlar dahil)
- Çok formatlı barkodlar: Aztec, Data Matrix, KOD 93, KOD 128, RSS Expanded Databar, UPS MaxiCode, ve USPS, IMB (OneCode) barkodları
- RSS-14 ve PDF-417 yığılı lineer barkodlar
- UPCA, UPCE, EAN-8, EAN-13, Codabar, ITF, MSI ve Plessey geleneksel sayısal barkod formatlarıdır.
Barkodu Yarat ve Kaydet
using IronBarCode;
// Create a barcode and save it in various formats
var MyBarCode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");
// Convert barcode to different image formats and obtain binary data
System.Drawing.Image MyBarCodeImage = MyBarCode.Image;
System.Drawing.Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte[] PngBytes = MyBarCode.ToPngBinaryData();
// Save barcode in PDF stream
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream())
{
// The Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}
// Stamp barcode onto an existing PDF at a specific position
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
using IronBarCode;
// Create a barcode and save it in various formats
var MyBarCode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128);
MyBarCode.SaveAsImage("MyBarCode.png");
MyBarCode.SaveAsGif("MyBarCode.gif");
MyBarCode.SaveAsHtmlFile("MyBarCode.html");
MyBarCode.SaveAsJpeg("MyBarCode.jpg");
MyBarCode.SaveAsPdf("MyBarCode.Pdf");
MyBarCode.SaveAsPng("MyBarCode.png");
MyBarCode.SaveAsTiff("MyBarCode.tiff");
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp");
// Convert barcode to different image formats and obtain binary data
System.Drawing.Image MyBarCodeImage = MyBarCode.Image;
System.Drawing.Bitmap MyBarCodeBitmap = MyBarCode.ToBitmap();
string DataURL = MyBarCode.ToDataUrl();
string ImgTagForHTML = MyBarCode.ToHtmlTag();
byte[] PngBytes = MyBarCode.ToPngBinaryData();
// Save barcode in PDF stream
using (System.IO.Stream PdfStream = MyBarCode.ToPdfStream())
{
// The Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
}
// Stamp barcode onto an existing PDF at a specific position
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50);
Imports IronBarCode
' Create a barcode and save it in various formats
Private MyBarCode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeEncoding.Code128)
MyBarCode.SaveAsImage("MyBarCode.png")
MyBarCode.SaveAsGif("MyBarCode.gif")
MyBarCode.SaveAsHtmlFile("MyBarCode.html")
MyBarCode.SaveAsJpeg("MyBarCode.jpg")
MyBarCode.SaveAsPdf("MyBarCode.Pdf")
MyBarCode.SaveAsPng("MyBarCode.png")
MyBarCode.SaveAsTiff("MyBarCode.tiff")
MyBarCode.SaveAsWindowsBitmap("MyBarCode.bmp")
' Convert barcode to different image formats and obtain binary data
Dim MyBarCodeImage As System.Drawing.Image = MyBarCode.Image
Dim MyBarCodeBitmap As System.Drawing.Bitmap = MyBarCode.ToBitmap()
Dim DataURL As String = MyBarCode.ToDataUrl()
Dim ImgTagForHTML As String = MyBarCode.ToHtmlTag()
Dim PngBytes() As Byte = MyBarCode.ToPngBinaryData()
' Save barcode in PDF stream
Using PdfStream As System.IO.Stream = MyBarCode.ToPdfStream()
' The Stream barcode image output also works for GIF, JPEG, PDF, PNG, BMP and TIFF
End Using
' Stamp barcode onto an existing PDF at a specific position
MyBarCode.StampToExistingPdfPage("ExistingPDF.pdf", 1, 200, 50)
Öte yandan, ZXing Java tabanlı, açık kaynaklı bir 1D/2D barkod görüntü işleme kütüphanesidir. UPC-A, UPC-E, EAN-8, Kod 93, Kod 128, QR Kodu, Data Matrix, Aztec, PDF 417 ve diğer barkod formatları desteklenmektedir.
Desteklenen Barkod Formatları
IronBarcode kullanarak QR Kod Dosyası Oluştur
IronBarcode ile QR kodları oluşturmak için, BarcodeWriter sınıfı yerine QRCodeWriter sınıfını kullanabiliriz. Bu sınıf, QR kodları oluşturmak için yeni ve ilginç özellikler tanıtmaktadır. QR hata düzeltme seviyesini ayarlamamıza olanak tanıyarak, QR kodunuzun boyutu ve okunabilirliği arasında bir denge kurmamızı sağlar.
using IronBarCode;
// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
using IronBarCode;
// Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png");
Imports IronBarCode
' Generate a simple QR Code image and save as PNG
QRCodeWriter.CreateQrCode("hello world", 500, QRCodeWriter.QrErrorCorrectionLevel.Medium).SaveAsPng("MyQR.png")
Hata düzeltme, gerçek dünyadaki durumlarda bir QR kodunun ne kadar kolay okunabileceğini belirlememize olanak tanır. Daha yüksek hata düzeltme seviyeleri, daha fazla piksel ve karmaşıklık içeren daha büyük QR kodlarına yol açar. Aşağıdaki resimde, QR kod dosyası görüntülenmektedir.
QR Kod Görüntüsü
Öncelikle, barkod değerini ve IronBarCode.BarcodeWriterEncoding enum'undan barkod formatını belirleyerek başlıyoruz. Ardından, bir görüntü, System.Drawing.Image veya Bitmap kod nesnesi olarak kaydedebiliriz.
using IronBarCode;
using System.Diagnostics;
// Generate a simple BarCode image and save as PNG using the following namespaces
GeneratedBarcode MyBarCode = IronBarCode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");
// This line opens the image in your default image viewer
Process.Start("MyBarCode.png");
using IronBarCode;
using System.Diagnostics;
// Generate a simple BarCode image and save as PNG using the following namespaces
GeneratedBarcode MyBarCode = IronBarCode.BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128);
MyBarCode.SaveAsPng("MyBarCode.png");
// This line opens the image in your default image viewer
Process.Start("MyBarCode.png");
Imports IronBarCode
Imports System.Diagnostics
' Generate a simple BarCode image and save as PNG using the following namespaces
Dim MyBarCode As GeneratedBarcode = BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.Code128)
MyBarCode.SaveAsPng("MyBarCode.png")
' This line opens the image in your default image viewer
Process.Start("MyBarCode.png")
C# Örneğinde Barkod Görüntüsü Oluşturma
IronBarcode ayrıca QR kodlarını stillendirmeyi, örneğin görüntü merkezinin tam ortasına yerleştirilmiş bir logo grafiği yerleştirmeyi destekler. Ayrıca belirli bir marka veya grafik kimliğine uygun olarak renklendirilebilir.
Test etmek için aşağıdaki kod örneğinde bir logo oluşturun ve QRCodeWriter.CreateQRCodeWithLogo yöntemini kullanmanın ne kadar basit olduğunu görün.
using IronBarCode;
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
using IronBarCode;
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
Imports IronBarCode
' Adding a Logo
Private MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
Logo Görüntüsü ile QR Kodu Oluştur
Sonunda oluşturulan QR kodunu bir PDF dosyası olarak kaydediyoruz. Kolaylık sağlamak amacıyla, son satır kod QR kodunu bir HTML dosyası olarak kaydeder.
using IronBarCode;
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
// Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");
// Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
using IronBarCode;
// Adding a Logo
var MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500);
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen);
// Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf");
// Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html");
Imports IronBarCode
' Adding a Logo
Private MyQRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/csharp/barcode/", "visual-studio-logo.png", 500)
MyQRWithLogo.ChangeBarCodeColor(System.Drawing.Color.DarkGreen)
' Save as PDF
MyQRWithLogo.SaveAsPdf("MyQRWithLogo.pdf")
' Also Save as HTML
MyQRWithLogo.SaveAsHtmlFile("MyQRWithLogo.html")
Aşağıda, bir barkod oluşturmanın, stillendirmenin ve dışa aktarmanın sadece bir satır kodla nasıl yapıldığını görüyoruz.
IronBarcode, System.Linq benzeri bir akıcı API içerir. Yöntem çağrılarını zincirleyerek bir barkod oluşturuyor, kenar boşluklarını ayarlıyor ve bir bitmap olarak dışa aktarıyoruz. Bu, oldukça yararlı olabilir ve kodun okunmasını kolaylaştırır.
using IronBarCode;
using System.Drawing;
// Fluent API for Barcode image generation
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarCode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417)
.ResizeTo(300, 200)
.SetMargins(100)
.ToBitmap();
using IronBarCode;
using System.Drawing;
// Fluent API for Barcode image generation
string MyValue = "https://ironsoftware.com/csharp/barcode";
Bitmap BarcodeBmp = IronBarCode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417)
.ResizeTo(300, 200)
.SetMargins(100)
.ToBitmap();
Imports IronBarCode
Imports System.Drawing
' Fluent API for Barcode image generation
Dim MyValue As String = "https://ironsoftware.com/csharp/barcode"
Dim BarcodeBmp As Bitmap = IronBarCode.BarcodeWriter.CreateBarcode(MyValue, BarcodeEncoding.PDF417) _
.ResizeTo(300, 200) _
.SetMargins(100) _
.ToBitmap()
Sonuç olarak, bir PDF417 barkodu System.Drawing.Image aşağıda gösterildiği gibi ortaya çıkar:
C#'da Basit, Akıcı PDF417 Barkod Üretimi
QR Kod Dosyalarını Okuma
IronBarcode ile QR Kodları Okuma
.NET barkod okuyucusu ile birlikte IronBarcode sınıf kütüphanesini kullandığınızda bir barkod veya QR kodu okuma işlemi çok kolaydır. İlk örneğimizde, yalnızca bir satır kod kullanarak bir barkodun nasıl okunacağını görebiliyoruz.
C# ile Tarama Yapılacak Kod 128 Barkod Görüntüsü
Barkodun değerini, görüntüsünü, kodlama türünü ve (varsa) iki değerli verisini elde edebilir ve ardından bunları konsola aktarabiliriz.
using IronBarCode;
using System;
// Read a barcode or QR code from an image
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result != null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
Console.WriteLine("GetStarted was a success. Read Value: " + Result.Text);
}
using IronBarCode;
using System;
// Read a barcode or QR code from an image
BarcodeResult Result = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png");
if (Result != null && Result.Text == "https://ironsoftware.com/csharp/barcode/")
{
Console.WriteLine("GetStarted was a success. Read Value: " + Result.Text);
}
Imports IronBarCode
Imports System
' Read a barcode or QR code from an image
Private Result As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("GetStarted.png")
If Result IsNot Nothing AndAlso Result.Text = "https://ironsoftware.com/csharp/barcode/" Then
Console.WriteLine("GetStarted was a success. Read Value: " & Result.Text)
End If
PDF'ler İçinde Barkod Okuma
Tarama yapılmış bir PDF belgesi okuyup, birkaç satır kod ile tüm bir boyutlu barkodları bulmayı inceleyeceğiz.
Görüldüğü üzere, tek bir belgede bir barkod okumaktan oldukça benzerdir, sadece barkodun hangi sayfada keşfedildiğini artık biliyoruz.
using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image. A PDF document may also be used as the input image
PagedBarcodeResult[] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
string Value = PageResult.Value;
int PageNum = PageResult.PageNumber;
System.Drawing.Bitmap Img = PageResult.BarcodeImage;
BarcodeEncoding BarcodeType = PageResult.BarcodeType;
byte[] Binary = PageResult.BinaryValue;
Console.WriteLine(PageResult.Value + " on page " + PageNum);
}
using IronBarCode;
using System;
using System.Drawing;
// Multiple barcodes may be scanned up from a single document or image. A PDF document may also be used as the input image
PagedBarcodeResult[] PDFResults = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf");
// Work with the results
foreach (var PageResult in PDFResults)
{
string Value = PageResult.Value;
int PageNum = PageResult.PageNumber;
System.Drawing.Bitmap Img = PageResult.BarcodeImage;
BarcodeEncoding BarcodeType = PageResult.BarcodeType;
byte[] Binary = PageResult.BinaryValue;
Console.WriteLine(PageResult.Value + " on page " + PageNum);
}
Imports IronBarCode
Imports System
Imports System.Drawing
' Multiple barcodes may be scanned up from a single document or image. A PDF document may also be used as the input image
Private PDFResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromPdf("MultipleBarcodes.pdf")
' Work with the results
For Each PageResult In PDFResults
Dim Value As String = PageResult.Value
Dim PageNum As Integer = PageResult.PageNumber
Dim Img As System.Drawing.Bitmap = PageResult.BarcodeImage
Dim BarcodeType As BarcodeEncoding = PageResult.BarcodeType
Dim Binary() As Byte = PageResult.BinaryValue
Console.WriteLine(PageResult.Value & " on page " & PageNum)
Next PageResult
Tüm Bitmap barkodları içeren sonuç verilerini alacaksınız.
PDF Sonuçlarında Saklanan Barkodları Okuma
GIF ve TIFF'ten Barkod Okuma
using IronBarCode;
using System;
// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult[] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
// Process each page result
}
using IronBarCode;
using System;
// Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
PagedBarcodeResult[] MultiFrameResults = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels);
foreach (var PageResult in MultiFrameResults)
{
// Process each page result
}
Imports IronBarCode
Imports System
' Multi-frame TIFF and GIF images can also be scanned, and multiple threads will be used automatically in the background for improved performance
Private MultiFrameResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesFromMultiFrameTiff("Multiframe.tiff", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.High, BarcodeReader.BarcodeImageCorrection.MediumCleanPixels)
For Each PageResult In MultiFrameResults
' Process each page result
Next PageResult
Çok kareli bir TIFF görüntüsünden barkod okumak
Aşağıdaki örnek, taranmış bir PDF'den QR kodları ve PDF-417 barkodlarını nasıl okunacağını göstermektedir. Harfiyle yakın seviyede barkod döndürmesini ve barkod görüntü düzeltmesini ayarladık, böylece belgeyi önemli bir performans cezasına uğramadan hafifçe temizlettik.
using IronBarCode;
using System;
// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);
// Work with the results
foreach (var PageResult in ScanResults)
{
string Value = PageResult.Value;
//...
}
using IronBarCode;
using System;
// PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
var ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels);
// Work with the results
foreach (var PageResult in ScanResults)
{
string Value = PageResult.Value;
//...
}
Imports IronBarCode
Imports System
' PDF documents can also be scanned, and multiple threads will be used automatically in the background for improved performance
Private ScanResults = BarcodeReader.ReadBarcodesFromPdf("Scan.pdf", BarcodeEncoding.All, BarcodeReader.BarcodeRotationCorrection.Low, BarcodeReader.BarcodeImageCorrection.LightlyCleanPixels)
' Work with the results
For Each PageResult In ScanResults
Dim Value As String = PageResult.Value
'...
Next PageResult
Tarama Yapılmış Bir PDF Belgesinden Barkod Okuma
Bitmap Görüntülerden Bozuk QR Kodları Okuma
Aşağıdaki örnek, C# barkod kütüphanesinin bozuk bir barkod küçük resmini bile okuyabildiğini gösteriyor.
Barkod küçük resim boyutu düzeltmesi otomatik olarak yapılır. C#'da IronBarcode bir dosyayı okunabilir hale getirir.
Okuyucu yöntemleri, meşru bir barkod olamayacak kadar küçük barkod görüntülerini otomatik olarak algılar ve büyütülmüş hale getirir. Küçük resimlerle çalışmanın getirisi olan tüm dijital gürültüyü temizleyerek, onları tekrar okunabilir hale getirirler.
using IronBarCode;
// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
using IronBarCode;
// Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
BarcodeResult SmallResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128);
Imports IronBarCode
' Small or 'Thumbnail' barcode images are automatically detected by IronBarcode and corrected wherever possible even if they have much digital noise.
Private SmallResult As BarcodeResult = BarcodeReader.QuicklyReadOneBarcode("ThumbnailOfBarcode.gif", BarcodeEncoding.Code128)
Otomatik Barkod Küçük Resim Boyutu Düzeltmesi
Eksik Görüntülerden Barkod Okumak
Gerçek dünya senaryolarında, eksik görüntülerden barkod okumak isteyebiliriz. Bu, eğilebilen görüntüler veya dijital gürültü içeren fotoğraflar olabilir. Bu, çoğu açık kaynaklı .NET barkod üretimi ve okuma kütüphanesiyle imkansız olurdu. Öte yandan, IronBarcode, eksik görüntülerden barkod okumayı çocuk oyuncağı hale getirir.
Şimdi ReadASingleBarcode yöntemine bakacağız. RotationCorrection parametresi ile IronBarcode, hatalı dijital örneklerden barkodları düzelterek okumaya çalışır.
using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
// * ImageCorrection e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
// * BarcodeEncoding e.g. BarcodeEncoding.Code128, Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte[] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);
using IronBarCode;
using System;
using System.Drawing;
// All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
// * RotationCorrection e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
// * ImageCorrection e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
// * BarcodeEncoding e.g. BarcodeEncoding.Code128, Setting a specific Barcode format improves speed and reduces the risk of false positive results
// Example with a photo image
var PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels);
string Value = PhotoResult.Value;
System.Drawing.Bitmap Img = PhotoResult.BarcodeImage;
BarcodeEncoding BarcodeType = PhotoResult.BarcodeType;
byte[] Binary = PhotoResult.BinaryValue;
Console.WriteLine(PhotoResult.Value);
Imports IronBarCode
Imports System
Imports System.Drawing
' All BarcodeResult.Read methods provide the developer with control to correct image and photograph correction and straightening rotation and perspective from skewed images
' * RotationCorrection e.g BarcodeReader.BarcodeRotationCorrection.Extreme un-rotates and removes perspective from barcode images.
' * ImageCorrection e.g BarcodeReader.BarcodeImageCorrection.DeepCleanPixels separates barcodes from background imagery and digital noise.
' * BarcodeEncoding e.g. BarcodeEncoding.Code128, Setting a specific Barcode format improves speed and reduces the risk of false positive results
' Example with a photo image
Private PhotoResult = BarcodeReader.ReadASingleBarcode("Photo.png", BarcodeEncoding.Code128, BarcodeReader.BarcodeRotationCorrection.Medium, BarcodeReader.BarcodeImageCorrection.DeepCleanPixels)
Private Value As String = PhotoResult.Value
Private Img As System.Drawing.Bitmap = PhotoResult.BarcodeImage
Private BarcodeType As BarcodeEncoding = PhotoResult.BarcodeType
Private Binary() As Byte = PhotoResult.BinaryValue
Console.WriteLine(PhotoResult.Value)
Bir Telefon Kamerasından Barkod Okuma
IronBarcode ayrıca aynı anda birden fazla barkodu okuyabilir. Belge listesi oluşturduğumuzda ve barkod okuyucusu kullanarak çok sayıda belge okuduğumuzda IronBarcode'dan daha iyi sonuç alıyoruz. Barkod tarama süreci için ReadBarcodesMultithreaded yöntemi birden fazla iş parçacığı ve potansiyel olarak CPU'nuzun tüm çekirdeklerini kullanır, bu da barkodları tek tek okumaktan katlanarak daha hızlı olabilir.
using IronBarCode;
// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs. All threads are automatically managed by IronBarcode.
var ListOfDocuments = new[] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult[] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);
// Work with the results
foreach (var Result in BatchResults)
{
string Value = Result.Value;
//...
}
using IronBarCode;
// The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs. All threads are automatically managed by IronBarcode.
var ListOfDocuments = new[] { "Image1.png", "image2.JPG", "image3.pdf" };
PagedBarcodeResult[] BatchResults = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments);
// Work with the results
foreach (var Result in BatchResults)
{
string Value = Result.Value;
//...
}
Imports IronBarCode
' The BarcodeResult.ReadBarcodesMultiThreaded method allows for faster barcode scanning of multiple images or PDFs. All threads are automatically managed by IronBarcode.
Private ListOfDocuments = { "Image1.png", "image2.JPG", "image3.pdf" }
Private BatchResults() As PagedBarcodeResult = BarcodeReader.ReadBarcodesMultiThreaded(ListOfDocuments)
' Work with the results
For Each Result In BatchResults
Dim Value As String = Result.Value
'...
Next Result
ZXing.NET ile QR Kodları Okuma ve Çözümleme
QR kod dosyalarını okumak için, kontrolcünüzde aşağıda gösterildiği gibi bir ViewFile aksiyon yöntemi ekleyin.
public ActionResult ViewFile()
{
List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
KeyValuePair<string, string> data;
string[] files = Directory.GetFiles(Server.MapPath("~/qrr"));
foreach (string file in files)
{
// Create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// Load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));
// Detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// Do something with the result
data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
fileData.Add(data);
}
return View(fileData);
}
public ActionResult ViewFile()
{
List<KeyValuePair<string, string>> fileData = new List<KeyValuePair<string, string>>();
KeyValuePair<string, string> data;
string[] files = Directory.GetFiles(Server.MapPath("~/qrr"));
foreach (string file in files)
{
// Create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// Load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile(Server.MapPath("~/qrr") + "/" + Path.GetFileName(file));
// Detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// Do something with the result
data = new KeyValuePair<string, string>(result.ToString(), "/QR/" + Path.GetFileName(file));
fileData.Add(data);
}
return View(fileData);
}
Public Function ViewFile() As ActionResult
Dim fileData As New List(Of KeyValuePair(Of String, String))()
Dim data As KeyValuePair(Of String, String)
Dim files() As String = Directory.GetFiles(Server.MapPath("~/qrr"))
For Each file As String In files
' Create a barcode reader instance
Dim reader As IBarcodeReader = New BarcodeReader()
' Load a bitmap
Dim barcodeBitmap = CType(Image.FromFile(Server.MapPath("~/qrr") & "/" & Path.GetFileName(file)), Bitmap)
' Detect and decode the barcode inside the bitmap
Dim result = reader.Decode(barcodeBitmap)
' Do something with the result
data = New KeyValuePair(Of String, String)(result.ToString(), "/QR/" & Path.GetFileName(file))
fileData.Add(data)
Next file
Return View(fileData)
End Function
QR Kodu Okuma ve Çözümleme
Kod Çözülmüş QR Kodu
Bitmap İçinde Bir Barkod Çözümleme
using ZXing;
using System.Drawing;
// Create a barcode reader instance
BarcodeReader reader = new BarcodeReader();
// Load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// Detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// Do something with the result
if (result != null)
{
txtDecoderType.Text = result.BarcodeFormat.ToString();
txtDecoderContent.Text = result.Text;
}
using ZXing;
using System.Drawing;
// Create a barcode reader instance
BarcodeReader reader = new BarcodeReader();
// Load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// Detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// Do something with the result
if (result != null)
{
txtDecoderType.Text = result.BarcodeFormat.ToString();
txtDecoderContent.Text = result.Text;
}
Imports ZXing
Imports System.Drawing
' Create a barcode reader instance
Private reader As New BarcodeReader()
' Load a bitmap
Private barcodeBitmap = CType(Image.FromFile("C:\sample-barcode-image.png"), Bitmap)
' Detect and decode the barcode inside the bitmap
Private result = reader.Decode(barcodeBitmap)
' Do something with the result
If result IsNot Nothing Then
txtDecoderType.Text = result.BarcodeFormat.ToString()
txtDecoderContent.Text = result.Text
End If
ZXing Çözümleyici Çevrimiçi
ZXing Çözümleyici Çevrimiçi, çözümlemeyi destekleyen çevrimiçi bir barkod ve QR kod tarayıcısıdır. Bir PNG veya başka bir formatta QR kod görüntüsü yükleyin ve çözümleme başlayacaktır. Benzer şekilde, herhangi bir veri için bir QR kodu oluşturabilirsiniz. Çoğu zaman, bu bilgi, bir QR koda kodlamak istediğiniz bir URL veya metin olacaktır.
ZXing Çözümleyici web sitesine gidin.
ZXing Çözümleyici Web Sitesi
ZXing Çözüm Sonucu
Fiyatlandırma ve Lisanslama
ZXing.NET kütüphanesi, barkod okuma uygulamaları oluşturmanıza olanak tanıyan, ücretsiz, açık kaynaklı bir kütüphane olup, uygun atıf ile ücretsiz ticari kullanım izni veren Apache License 2.0 altında lisanslanmıştır.
IronBarcode için geliştirici lisansı ücretsiz olarak sunulmaktadır. IronBarcode'un benzersiz bir fiyatlandırma düzeni vardır: Lite paketi $liteLicense'dan başlamakta ve ek maliyet içermemektedir. SaaS ve OEM ürünleri de yeniden dağıtılabilir. Her lisans, süresiz bir lisans, geliştirme/alım/üretim geçerliliği, 30 günlük para iade garantisi ve bir yıllık yazılım desteği ve güncellemelerini (tek seferlik satın alma) içerir. IronBarcode'un tam fiyatlandırma ve lisans bilgilerini görüntülemek için bu sayfayı ziyaret edin.
Neden IronBarcode'u Seçmelisiniz?
IronBarcode, .NET'te barkodları okumak ve yazmak için geliştiricilere kolayca kullanılabilir bir API sağlar, bu da gerçek dünya kullanım durumlarında doğruluğu ve düşük hata oranını optimize eder.
Örneğin, BarcodeWriter sınıfı, UPCA ve UPCE barkodlarında 'kontrol toplamlarını' doğrular ve düzeltir. Ayrıca belirli bir sayısal forma girilemeyecek kadar kısa olan sayıları 'sıfır doldurur'. Verileriniz belirtilen veri formatı ile uyumlu değilse, IronBarcode, geliştiriciye kullanabilecekleri daha uygun bir barkod formatı hakkında bilgi verecektir.
IronBarcode, barkodun tarandığı veya fotoğrafik bir görüntüden okunduğu durumlarda barkodları okumada mükemmeldir, yani görüntü tam olarak grafiksel değilse ve makine tarafından üretilmiş bir ekran görüntüsü değilse.
IronBarcode ZXing.NET'ten Nasıl Farklıdır?
IronBarcode, ZXing.NET (Zebra Crossing) çekirdek üzerine inşa edilmiş olup, gelişmiş işlem yeteneklerine sahiptir. Kullanımı kolay bir API ile gelir ve ZXing.NET çekirdek kütüphanesine kıyasla düşük hata oranına sahiptir. Bununla birlikte, IronBarcode, genelde ZXing.NET kütüphanesinin desteklediğinden daha geniş bir barkod formatı yelpazesini destekler.
IronBarcode, ZXing.NET'in daha gelişmiş bir versiyonudur ve kullanıcıya ticari kullanım platformu ve aynı paketi birden fazla platformda kullanma olanağı sunar. Ayrıca, size gerektiği yerde yardımcı olmaya her zaman hazır olan tam teknik destek hizmeti de bulunmaktadır.
IronBarcode, otomatik döndürme, perspektif düzeltme ve dijital gürültü düzeltme içerir ve bir görüntüde kodlanmış barkod türünü algılayabilir.
Sonuç
Sonuç olarak, IronBarcode, ekran görüntüleri, fotoğraflar, taramalar veya diğer kusurlu gerçek dünya görüntüleri olsun, geniş bir barkod formatı yelpazesini okuyabilen çok yönlü bir .NET yazılım kütüphanesi ve C# QR kod oluşturan bir araçtır.
IronBarcode, barkodları oluşturan ve tanımlayan en etkili kütüphanelerden biridir. Barkod oluşturmada ve tanımlamada aynı zamanda en hızlı kütüphaneler arasındadır. Kütüphane, farklı işletim sistemleriyle uyumludur. Tasarımı kolaydır ve geniş bir barkod formatı yelpazesini destekler. Ek olarak, çeşitli semboller, formatlar ve karakterler desteklenir.
ZXing.NET barkodu, çeşitli resim formatlarında barkodları oluşturma ve tanıma yeteneğine sahip güçlü bir kütüphanedir. Çeşitli formatlarda görüntüler okuyup oluşturabiliriz. ZXing.NET ayrıca bir barkodun görünümünü değiştirmeye, yüksekliğini, genişliğini, barkod metnini ve benzeri kontrol etmeye de olanak tanır.
ZXing.NET ile karşılaştırıldığında, IronBarcode paketleri güvenilir lisanslama ve destek sunmaktadır. IronBarcode $liteLicense ucuza mal oluyor. ZXing ücretsiz ve açık kaynaklı olmasına rağmen IronBarcode kapsamlı ticari destek ve profesyonel bakım sağlar. ZXing.NET'ten daha esnek olmasının yanı sıra, IronBarcode çözümü de daha fazla işlevselliğe sahiptir. Böylece, IronBarcode'un ZXing.NET'e büyük bir avantaj sağladığı açıktır.
Barkodları tanıma ve oluşturma işlem sürelerini karşılaştırdığımızda, IronBarcode, ZXing.NET'i geride bırakır. IronBarcode ayrıca farklı resim formatlarından ve PDF belgelerinden barkod okuma yeteneğini sağlayan birkaç özelliğe sahiptir. Ayrıca, barkod veya QR kodu içine resimleri ekleme olanağı da sunar, bu hiçbir başka kütüphanede mevcut değildir.
IronBarcode, geliştirme aşamalarında ücretsizdir. Üretim seviyesi veya ticari kullanım için bir ücretsiz deneme edinebilirsiniz. Geliştiricinin gereksinimlerine bağlı olarak, IronBarcode üç fiyatlandırma kademesi sunmaktadır. İhtiyaçlarınızı en iyi şekilde karşılayan çözümü seçebilirsiniz. Artık iki Iron Software ürünü fiyatına beş Iron Software ürününü satın alabilirsiniz. Daha fazla bilgi için bu web sitesini ziyaret edin.
Sıkça Sorulan Sorular
C# dilinde bir QR kodu nasıl oluşturabilirim?
IronBarcode'un `BarcodeWriter` sınıfını kullanarak C#'ta bir QR kodu üretebilirsiniz. Sadece QR kodu içeriğini tanımlayın, renk ve boyut gibi seçenekleri özelleştirin, ve QR kodunu oluşturmak için `Write` metodunu çağırın.
IronBarcode'u ZXing.NET'ten daha sağlam yapan nedir?
IronBarcode, daha geniş bir barkod formatları yelpazesi desteği, döndürme ve perspektif düzeltmesi gibi gelişmiş görüntü işleme özellikleri ve logolar ve renklerle süslenmiş QR kodları yaratma yeteneği gibi gelişmiş yetenekler sunar. Ayrıca çapraz platform uyumluluğu sağlar ve ticari destek sunar.
IronBarcode kullanarak kusurlu görüntülerden barkod okuyabilir miyim?
Evet, IronBarcode, döndürme düzeltmesi, perspektif düzeltmesi ve dijital gürültü azaltma gibi özellikleri kullanarak kusurlu görüntülerden barkod okuyabilir, böylece taranan veya fotoğraflı görüntüler için etkili hale gelir.
C#'ta bir barkod okumak için adımlar nelerdir?
C#'ta bir barkod okumak için IronBarcode'un `BarcodeReader` sınıfını kullanın. `BarcodeReader.QuicklyReadOneBarcode` metodunu kullanarak barkod içeren resmi yükleyin, bu metod tanımlanırsa barkod içeriğini kodlayacak ve döndürecektir.
IronBarcode çapraz platform uyumluluğunu nasıl ele alır?
IronBarcode, Windows, macOS, Linux ve Azure için çapraz-platform uyumluluğunu destekler, üçüncü taraf bağımlılıkları olmaksızın çeşitli .NET uygulamalarına barkod üretme ve okuma işlevlerini entegre etmenizi sağlar.
IronBarcode ile QR kodlarını özelleştirmek için hangi seçenekler mevcuttur?
IronBarcode, renk ayarlama, markalama için logolar ekleme ve okunabilirliği ve boyutu dengelemek için hata düzeltme seviyelerini yapılandırma gibi imkanlar sunarak çeşitli estetik ve işlevsel gereksinimler için esneklik sağlar.
IronBarcode'un ticari uygulamalarda kullanım için lisans ücreti var mı?
IronBarcode, ticari uygulamalara uygun süresiz lisans da dahil olmak üzere farklı lisanslama seçenekleri sunar. Bu, ücretsiz ancak ticari kullanım için sınırlamalı ZXing.NET ile çelişmektedir.
Barkod kütüphaneleri kullanırken yaygın sorun çözme senaryoları nelerdir?
Yaygın sorunlar, görüntü kalitesinin zayıf olması nedeniyle hatalı barkod tanıma, desteklenmeyen barkod formatları veya yapılandırma hatalarını içerebilir. IronBarcode'un gelişmiş görüntü işleme özelliği, bazı tanıma sorunlarını hafifletebilir.
Biri neden barkod işlemi için ZXing.NET yerine IronBarcode'u seçebilir?
IronBarcode, daha gelişmiş bir API, daha iyi hata yönetimi, kapsamlı barkod format desteği ve ticari lisanslama ile profesyonel destek ile birlikte gelen görsel olarak özelleştirilmiş QR kodları oluşturma özelliklerini sağlar.
IronBarcode'u bir .NET projesine nasıl kurabilirim?
IronBarcode'u bir .NET projesine NuGet Paket Yöneticisi ile Visual Studio'da 'IronBarcode' aratarak ve projenize ekleyerek, kolay entegrasyon ve güncellemeler sağlayarak kurabilirsiniz.

