Skip to main content

BarCodeGeneratorOptions Class

Base class for symbology-specific options.

Namespace: DevExpress.BarCodes

Assembly: DevExpress.Docs.v26.1.dll

Declaration

public abstract class BarCodeGeneratorOptions

Remarks

Note

This documentation describes the legacy Barcode Generation API. For new projects, use the DevExpress.Docs.Barcode.BarcodeGenerator class in the DevExpress.Docs.Barcode namespace. To upgrade an existing project to the updated scheduler control, refer to the Migration Guide.

The BarCodeGeneratorOptions class is a base class for all symbology-specific options. Use the BarCode.Options property to access these options.

The following code snippet creates a QR code, specifies its options, and saves it as an image:

using DevExpress.BarCodes;
//...

BarCode barCode = new BarCode();
barCode.Symbology = Symbology.QRCode;
barCode.CodeText = "https://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;
barCode.Module = 2f;

barCode.Save("BarCodeImage.png", System.Drawing.Imaging.ImageFormat.Png);
See Also