Skip to main content
A newer version of this page is available. .

Getting Started

  • 2 minutes to read

Important

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

To get started with a Bar Code library, perform the following steps.

  1. Create a new Windows Forms Application project.
  2. Add reference to the DevExpress.Docs.v17.2.dll and the DevExpress.Data.v17.2.dll assemblies.
  3. Drag a Button from the Toolbox and drop it on the form. Drag a PictureBox from the Toolbox and drop it on the form.
  4. Insert the code listed below into the method that handles the Click button event.

    using DevExpress.BarCodes;
    //...
    this.pictureBox1.Image = null;
    BarCode barCode = new BarCode();
    barCode.Symbology = Symbology.QRCode;
    barCode.CodeText = "http://www.devexpress.com";
    barCode.BackColor = Color.White;
    barCode.ForeColor = Color.Black;
    barCode.RotationAngle = 0;
    barCode.CodeBinaryData = Encoding.Default.GetBytes(barCode.CodeText);
    barCode.Options.QRCode.CompactionMode = QRCodeCompactionMode.Byte;
    barCode.Options.QRCode.ErrorLevel = QRCodeErrorLevel.Q;
    barCode.Options.QRCode.ShowCodeText = false;
    barCode.DpiX = 72;
    barCode.DpiY = 72;
    this.pictureBox1.Image = barCode.BarCodeImage;
    pictureBox1.Size = pictureBox1.Image.Size;
    
  5. Run the project and click the button. See the resulting QR barcode in the PictureBox control.
See Also