样式二维码
在 IronBarcode 中,二维码可以添加徽标、更改颜色、打印注释文本和设置页边距。
using IronBarCode; using IronSoftware.Drawing; GeneratedBarcode myQRCode = QRCodeWriter.CreateQrCode("https://ironsoftware.com/"); // You may add annotation text myQRCode.SetMargins(40, 10, 10, 10); myQRCode.AddAnnotationTextAboveBarcode("Your code is: " + myQRCode.Value).SaveAsPng("ironsoftware.png"); // You may add styling with color, logo images or branding: var qrCodeLogo = new QRCodeLogo("ironsoftware_logo.png"); GeneratedBarcode myQRCodeWithLogo = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/", qrCodeLogo); myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen); // Logo will automatically be sized appropriately and snapped to the QR grid. myQRCodeWithLogo.SaveAsPng("myQRWithLogo.png");
Imports IronBarCode Imports IronSoftware.Drawing Private myQRCode As GeneratedBarcode = QRCodeWriter.CreateQrCode("https://ironsoftware.com/") ' You may add annotation text myQRCode.SetMargins(40, 10, 10, 10) myQRCode.AddAnnotationTextAboveBarcode("Your code is: " & myQRCode.Value).SaveAsPng("ironsoftware.png") ' You may add styling with color, logo images or branding: Dim qrCodeLogo As New QRCodeLogo("ironsoftware_logo.png") Dim myQRCodeWithLogo As GeneratedBarcode = QRCodeWriter.CreateQrCodeWithLogo("https://ironsoftware.com/", qrCodeLogo) myQRCodeWithLogo.ResizeTo(500, 500).SetMargins(10).ChangeBarCodeColor(Color.DarkGreen) ' Logo will automatically be sized appropriately and snapped to the QR grid. myQRCodeWithLogo.SaveAsPng("myQRWithLogo.png")
Install-Package BarCode
在 IronBarcode 中,二维码可以添加徽标、更改颜色、打印注释文本和设置页边距。