ByteScout BarCode Generator SDK - C# - QR Code With Image - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout BarCode Generator SDK – C# – QR Code With Image

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – C# – QR Code With Image

ByteScout BarCode Generator SDK – C# – QR Code With Image

Program.cs

using System;
using Bytescout.BarCode;

namespace QRCodeWithImage
{
	class Program
	{
		static void Main(string[] args)
		{
			const string decorationImageFile = @".\logo.png";
			const string outputFile = @".\barcode.png";
			const string barcodeValue = "1234567890 abcdefghijklmnopqrstuvwxyz 1234567890 abcdefghijklmnopqrstuvwxyz";
			
			// Create and activate barcode generator instance
			using (Barcode barcode = new Barcode("demo", "demo"))
			{
				// Set barcode type
				barcode.Symbology = SymbologyType.QRCode;

				// Set high QR Code error correction level
				barcode.Options.QRErrorCorrectionLevel = QRErrorCorrectionLevel.High;

				// Set barcode value
				barcode.Value = barcodeValue;

				// Add decoration image and scale it to 15% of the barcode square
				barcode.AddDecorationImage(decorationImageFile, 15);

				// Save generated barcode
				barcode.SaveImage(outputFile);

				Console.WriteLine("Barcode saved to " + outputFile);

				Console.WriteLine();
				Console.WriteLine("Press any key...");
				Console.ReadKey();
			}
		}
	}
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next