Back to Devexpress

QRFrameOptions Class

corelibraries-devexpress-dot-xtraprinting-dot-barcode-32d7ba26.md

latest4.5 KB
Original Source

QRFrameOptions Class

Contains options used to configure the frame for QR codes.

Namespace : DevExpress.XtraPrinting.BarCode

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public abstract class QRFrameOptions
vb
Public MustInherit Class QRFrameOptions

The following members return QRFrameOptions objects:

LibraryRelated API Members
Cross-Platform Class LibraryQRCodeGenerator.FrameOptions
Office File APIQRCodeOptions.FrameOptions

Remarks

QR Code, GS1 QR Code, EPC QR Code support the following frames (the QRFrameOptions descendants):

In the Visual Studio Report Designer, go to BehaviorSymbologyFrameOptions, select the frame type, and specify the available properties:

To add a new frame in code, select one of the frame types and assign its new instance to the QR code’s QRCodeGenerator.FrameOptions property:

csharp
using DevExpress.XtraPringing.BarCode;

public XRBarCode CreateQRCodeBarCode(string BarCodeText) {
    // Create a barcode control.
    XRBarCode barCode = new XRBarCode();

    // Set the barcode's type to QRCode.
    barCode.Symbology = new QRCodeGenerator();

    // ...

    // Set a rectangular frame and specifies its options.
    RectangleQRFrameOptions frameOpt = new RectangleQRFrameOptions() {
        FrameWidth = 2,
        FrameColor = System.Drawing.Color.DarkRed,                
        Text = "Scan me",
        TextAlignment = QRFrameTextAlignment.Baseline,
        TextPosition = QRFrameTextPosition.Top,
        CornerRadius = 5
    };
    ((QRCodeGenerator)barCode.Symbology).FrameOptions = frameOpt;

    return barCode;
}
vb
Imports DevExpress.XtraPringing.BarCode

Public Function CreateQRCodeBarCode(ByVal BarCodeText As String) As XRBarCode
    ' Create a barcode control.
    Dim barCode As New XRBarCode()

    ' Set the barcode's type to QRCode.
    barCode.Symbology = New QRCodeGenerator()

    ' ...

    ' Set a rectangular frame and specifies its options.
    Dim frameOpt As New RectangleQRFrameOptions() With {
        .FrameWidth = 2,
        .FrameColor = System.Drawing.Color.DarkRed,
        .Text = "Scan me",
        .TextAlignment = QRFrameTextAlignment.Baseline,
        .TextPosition = QRFrameTextPosition.Top,
        .CornerRadius = 5
    }
    CType(barCode.Symbology, QRCodeGenerator).FrameOptions = frameOpt

    Return barCode
End Function

The resulted frame:

Inheritance

Object QRFrameOptions CornerQRFrameOptions

RectangleQRFrameOptions

PaymentServicesAustriaQRFrameOptions

See Also

QRFrameOptions Members

DevExpress.XtraPrinting.BarCode Namespace