Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

QRCodeOptions Class

Contains options specific to the QR symbology.

Namespace: DevExpress.BarCodes

Assembly: DevExpress.Docs.v24.2.dll

NuGet Package: DevExpress.Document.Processor

#Declaration

public class QRCodeOptions :
    BarCodeGeneratorOptions

The following members return QRCodeOptions objects:

#Remarks

Access the QRCodeOptions object using the BarCodeOptions.QRCode property.

The code sample below creates a QR code and displays it in a PictureBox.

using System;
using System.Text;
using DevExpress.BarCodes;
using DevExpress.Drawing;
using DevExpress.Drawing.Extensions;
//...

private void button1_Click(object sender, EventArgs e)
{
    this.pictureBox1.Image = null;

    BarCode barCode = new BarCode();
    barCode.Symbology = Symbology.QRCode;
    barCode.BackColor = Color.White;
    barCode.ForeColor = Color.Black;
    barCode.RotationAngle = 0;
    barCode.CodeBinaryData = Encoding.Default.GetBytes("https://www.devexpress.com/");
    barCode.Options.QRCode.CompactionMode = QRCodeCompactionMode.Byte;
    barCode.Options.QRCode.ErrorLevel = QRCodeErrorLevel.Q;
    barCode.Options.QRCode.ShowCodeText = true;
    barCode.DpiX = 72;
    barCode.DpiY = 72;
    barCode.Module = 2f;

    this.pictureBox1.Image = barCode.BarCodeImage.ConvertToGdiPlusImage();
}
See Also