Test in production without watermarks.
Works wherever you need it to.
Get 30 days of fully functional product.
Have it up and running in minutes.
Full access to our support engineering team during your product trial
In this tutorial, we explore creating barcode and QR code images in C# using the Iron Barcode library. Starting with a program CS file, we access Iron Barcode's features by importing its namespace. We then create a QR code embedding the Iron Barcode URL, defining a size of 500 pixels and a high error correction level. The tutorial demonstrates saving the generated barcode in formats like JPEG, GIF, PNG, TIFF, and as a Windows bitmap. The efficiency of Iron Barcode ensures clear, readable barcodes in any format, emphasizing its versatility. The video encourages viewers to try Iron Barcode's 30-day trial to experience its capabilities firsthand. This guide serves as an excellent resource for developers looking to integrate barcode generation into their applications effortlessly.
Here is an example of how you can implement the QR code generation in C# using Iron Barcode:
using IronBarCode; // Import the Iron Barcode namespace
namespace BarcodeGenerator
{
class Program
{
static void Main(string[] args)
{
// Define the URL to be encoded in the QR code
string url = "https://ironsoftware.com";
// Generate a QR code with the specified URL, with a size of 500 pixels, and with a high error correction level
var qrCode = QRCodeWriter.CreateQrCode(url, 500, QRCodeWriter.QRCodeErrorCorrectionLevel.High);
// Save the generated QR code in different formats
qrCode.SaveAsPng("QRCode.png"); // Save as PNG
qrCode.SaveAsJpeg("QRCode.jpeg"); // Save as JPEG
qrCode.SaveAsGif("QRCode.gif"); // Save as GIF
qrCode.SaveAsTiff("QRCode.tiff"); // Save as TIFF
qrCode.SaveAsBitmap("QRCode.bmp"); // Save as Bitmap
}
}
}
using IronBarCode; // Import the Iron Barcode namespace
namespace BarcodeGenerator
{
class Program
{
static void Main(string[] args)
{
// Define the URL to be encoded in the QR code
string url = "https://ironsoftware.com";
// Generate a QR code with the specified URL, with a size of 500 pixels, and with a high error correction level
var qrCode = QRCodeWriter.CreateQrCode(url, 500, QRCodeWriter.QRCodeErrorCorrectionLevel.High);
// Save the generated QR code in different formats
qrCode.SaveAsPng("QRCode.png"); // Save as PNG
qrCode.SaveAsJpeg("QRCode.jpeg"); // Save as JPEG
qrCode.SaveAsGif("QRCode.gif"); // Save as GIF
qrCode.SaveAsTiff("QRCode.tiff"); // Save as TIFF
qrCode.SaveAsBitmap("QRCode.bmp"); // Save as Bitmap
}
}
}
Imports IronBarCode ' Import the Iron Barcode namespace
Namespace BarcodeGenerator
Friend Class Program
Shared Sub Main(ByVal args() As String)
' Define the URL to be encoded in the QR code
Dim url As String = "https://ironsoftware.com"
' Generate a QR code with the specified URL, with a size of 500 pixels, and with a high error correction level
Dim qrCode = QRCodeWriter.CreateQrCode(url, 500, QRCodeWriter.QRCodeErrorCorrectionLevel.High)
' Save the generated QR code in different formats
qrCode.SaveAsPng("QRCode.png") ' Save as PNG
qrCode.SaveAsJpeg("QRCode.jpeg") ' Save as JPEG
qrCode.SaveAsGif("QRCode.gif") ' Save as GIF
qrCode.SaveAsTiff("QRCode.tiff") ' Save as TIFF
qrCode.SaveAsBitmap("QRCode.bmp") ' Save as Bitmap
End Sub
End Class
End Namespace
Further Reading: How to Create Barcode Images