QRCodeGenerator.Logo Property
Specifies the image that overlays the QR code.
Namespace: DevExpress.XtraPrinting.BarCode
Assembly: DevExpress.Printing.v24.2.Core.dll
NuGet Package: DevExpress.Printing.Core
#Declaration
[DefaultValue(null)]
public ImageSource Logo { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Image |
null | The image to be displayed on the QR code. |
#Remarks
Use this property to specify an image for a QR code. For example, guidelines on Swiss bill reports demand that a QR code has a Swiss cross logo. The Create a Swiss QR Bill topic explains how to set up a QR code for a Swiss QR-bill report.
You can assign images of the following formats: BMP, JPG, JPEG, GIF, TIF, TIFF, PNG, ICO, DIB, RLE, JPE, JFIF, EMF, WMF, SVG.
Note
The Logo property is ignored when the Auto
If the Logo property is specified, the QRCode
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraPrinting.Drawing;
using DevExpress.XtraReports.UI;
// ...
public XRBarCode CreateQRCode(string BarCodeText) {
// Create a bar code control.
XRBarCode barCode = new XRBarCode();
// Set the bar code's type to QRCode.
barCode.Symbology = new QRCodeGenerator();
barCode.ShowText = false;
barCode.Width = 470;
barCode.Height = 470;
barCode.Module = 4.07F;
// Adjust the properties specific to the bar code type.
((QRCodeGenerator)barCode.Symbology).CompactionMode = QRCodeCompactionMode.Byte;
((QRCodeGenerator)barCode.Symbology).ErrorCorrectionLevel = QRCodeErrorCorrectionLevel.M;
((QRCodeGenerator)barCode.Symbology).Version = QRCodeVersion.Version24;
((QRCodeGenerator)barCode.Symbology).Logo = ImageSource.FromFile(@"..\..\CH-Kreuz_7mm.svg");
return barCode;
}