using System;
using IronBarCode;
using System.Drawing; // Include a reference to System.Drawing.Dll
/*** GENERATING QR CODES WITH THE QRCODEWRITER CLASS ***/
// Using the QRCodeWriter.CreateQrCodeWithLogo Method instead of BarcodeWriter.CreateBarcode exposes additional QR creation options.
// Choosing a high QRCodeWriter.QrErrorCorrectionLevel makes QR codes more fault tolerant and faster to read
GeneratedBarcode RandomQR = QRCodeWriter.CreateQrCode(Guid.NewGuid().ToString(), 500, QRCodeWriter.QrErrorCorrectionLevel.Highest);
RandomQR.AddAnnotationTextAboveBarcode("Your Random Key is" + RandomQR.Value).SaveAsJpeg("RandomQR.jpeg");
/*** STYING QR CODES WITH LOGO IMAGES OR BRANDING ***/
// Use the QRCodeWriter.CreateQrCodeWithLogo Method instead of BarcodeWriter.CreateBarcode
// Logo will automatically be sized appropriately and snapped to the QR grid.
GeneratedBarcode QRWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://visualstudio.microsoft.com/", "visual-studio-logo.png");
QRWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen);
QRWithLogo.SaveAsPng("QRWithLogo.Png").SaveAsPdf("MyVerifiedQR.html"); // save as 2 formats
Imports System
Imports IronBarCode
Imports System.Drawing ' Include a reference to System.Drawing.Dll
'''* GENERATING QR CODES WITH THE QRCODEWRITER CLASS **
' Using the QRCodeWriter.CreateQrCodeWithLogo Method instead of BarcodeWriter.CreateBarcode exposes additional QR creation options.
' Choosing a high QRCodeWriter.QrErrorCorrectionLevel makes QR codes more fault tolerant and faster to read
Private RandomQR As GeneratedBarcode = QRCodeWriter.CreateQrCode(Guid.NewGuid().ToString(), 500, QRCodeWriter.QrErrorCorrectionLevel.Highest)
RandomQR.AddAnnotationTextAboveBarcode("Your Random Key is" & RandomQR.Value).SaveAsJpeg("RandomQR.jpeg")
'''* STYING QR CODES WITH LOGO IMAGES OR BRANDING **
' Use the QRCodeWriter.CreateQrCodeWithLogo Method instead of BarcodeWriter.CreateBarcode
' Logo will automatically be sized appropriately and snapped to the QR grid.
Dim QRWithLogo As GeneratedBarcode = QRCodeWriter.CreateQrCodeWithLogo("https://visualstudio.microsoft.com/", "visual-studio-logo.png")
QRWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen)
QRWithLogo.SaveAsPng("QRWithLogo.Png").SaveAsPdf("MyVerifiedQR.html") ' save as 2 formats