Skip to main content
All docs
V26.1
  • QRCodeOptionsBuilder Class

    Builds a QRCodeOptions object. Chain builder methods to configure barcode settings, then call the Build method to create the options object.

    Namespace: DevExpress.Docs.Barcode

    Assembly: DevExpress.Docs.Core.v26.1.dll

    Declaration

    public class QRCodeOptionsBuilder :
        BarcodeOptionsBuilder<QRCodeOptions, QRCodeOptionsBuilder>

    Remarks

    The following code snippet creates a QR Code barcode and specifies its settings:

    DevExpress Barcode Generator - QR Code barcode

    using DevExpress.Docs.Barcode;
    using DevExpress.Drawing;
    using System.Drawing;
    
    using var fileStream = new FileStream("logo.png", FileMode.Open);
    
    var qrcode = QRCodeOptionsBuilder.Create()
        .WithErrorCorrectionLevel(QRCodeErrorCorrectionLevel.H)
        .WithCompactionMode(QRCodeCompactionMode.Auto)
        .WithIncludeQuietZone(true)
        .WithLogo(DXImage.FromStream(fileStream))
        .WithVersion(QRCodeVersion.Version10)
        .WithModuleSize(40)
        .WithBackColor(Color.LightGray)
        .WithShowText(false)
        .WithPadding(5)
        .WithBorderWidth(1)
        .WithBorderColor(Color.Blue)
        .Build();
    
    var filePath = Path.GetFullPath("qrcode.png");
    
    using var stream = new FileStream(filePath, FileMode.Create);
    using var generator = new BarcodeGenerator(qrcode);
    generator.Export("https://www.devexpress.com", stream, DXImageFormat.Png);
    
    See Also