Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / BarcodeQRWrite Method / BarcodeQRWrite(Int32,String,BarcodeQREncodingMode,BarcodeQRErrorCorrectionLevel,Int32,Int32,Int32,Int32,Int32,Single,Color,Color) Method
GdPicture image identifier.
The data of the barcode to encode.
A member of the BarcodeQREncodingMode enumeration. The encoding mode.
A member of the BarcodeQRErrorCorrectionLevel enumeration. The error correction level.
The version of the QrCode. In the range 0 - 40. Specifies the overall dimensions of the symbol. Use 0 to let the engine decide the minimum version required to encode all data.
The number of modules composing the quiet zone. The quiet zone defines the margin around the barcode. QR Code requires a four-module wide margin at all sides of a symbol. Consequently a value superior or equal to 4 is highly suggested.
The size of each module, in pixels. A value superior or equal to 4 is recommended.
The left position, in pixels, of the QrCode.
The top position, in pixels, of the QrCode.
The QrCode angle.
Color of the symbols. A suitable color value can be obtained by using the ARGB() method.
Color of the background. A suitable color value can be obtained by using the ARGB() method.
Example





In This Topic
    BarcodeQRWrite(Int32,String,BarcodeQREncodingMode,BarcodeQRErrorCorrectionLevel,Int32,Int32,Int32,Int32,Int32,Single,Color,Color) Method
    In This Topic
    Draws a QrCode barcode on a GdPicture image.
    Syntax
    'Declaration
     
    
    Public Overloads Function BarcodeQRWrite( _
       ByVal ImageID As Integer, _
       ByVal Data As String, _
       ByVal EncodingMode As BarcodeQREncodingMode, _
       ByVal ErrorCorrectionLevel As BarcodeQRErrorCorrectionLevel, _
       ByVal Version As Integer, _
       ByVal QuietZone As Integer, _
       ByVal ModuleSize As Integer, _
       ByVal DstLeft As Integer, _
       ByVal DstTop As Integer, _
       ByVal Angle As Single, _
       ByVal FillColor As Color, _
       ByVal BackColor As Color _
    ) As GdPictureStatus
    public function BarcodeQRWrite( 
        ImageID: Integer;
        Data: String;
        EncodingMode: BarcodeQREncodingMode;
        ErrorCorrectionLevel: BarcodeQRErrorCorrectionLevel;
        Version: Integer;
        QuietZone: Integer;
        ModuleSize: Integer;
        DstLeft: Integer;
        DstTop: Integer;
        Angle: Single;
        FillColor: Color;
        BackColor: Color
    ): GdPictureStatus; 
    public function BarcodeQRWrite( 
       ImageID : int,
       Data : String,
       EncodingMode : BarcodeQREncodingMode,
       ErrorCorrectionLevel : BarcodeQRErrorCorrectionLevel,
       Version : int,
       QuietZone : int,
       ModuleSize : int,
       DstLeft : int,
       DstTop : int,
       Angle : float,
       FillColor : Color,
       BackColor : Color
    ) : GdPictureStatus;

    Parameters

    ImageID
    GdPicture image identifier.
    Data
    The data of the barcode to encode.
    EncodingMode
    A member of the BarcodeQREncodingMode enumeration. The encoding mode.
    ErrorCorrectionLevel
    A member of the BarcodeQRErrorCorrectionLevel enumeration. The error correction level.
    Version
    The version of the QrCode. In the range 0 - 40. Specifies the overall dimensions of the symbol. Use 0 to let the engine decide the minimum version required to encode all data.
    QuietZone
    The number of modules composing the quiet zone. The quiet zone defines the margin around the barcode. QR Code requires a four-module wide margin at all sides of a symbol. Consequently a value superior or equal to 4 is highly suggested.
    ModuleSize
    The size of each module, in pixels. A value superior or equal to 4 is recommended.
    DstLeft
    The left position, in pixels, of the QrCode.
    DstTop
    The top position, in pixels, of the QrCode.
    Angle
    The QrCode angle.
    FillColor
    Color of the symbols. A suitable color value can be obtained by using the ARGB() method.
    BackColor
    Color of the background. A suitable color value can be obtained by using the ARGB() method.

    Return Value

    A member of the GdPictureStatus enumeration.
    Example
    Rendering a QrCode to a new image and saving the result into a png file.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        // String that have to be encoded into a barcode.
        string data = "Encoding Qr Code";
     
        BarcodeQREncodingMode encodingMode = BarcodeQREncodingMode.BarcodeQREncodingModeUndefined;
        BarcodeQRErrorCorrectionLevel errorCorrectionLevel = BarcodeQRErrorCorrectionLevel.BarcodeQRErrorCorrectionLevelM;
        int version = 0;
        int moduleSize = 7;
        int quietZone = 4;
        Color fillColor = gdpictureImaging.ARGB(255, 0, 0, 0);
        Color backColor = gdpictureImaging.ARGB(0, 255, 255, 255);
     
        // Compute size (in pixels), required to render a Qr Code.
        int size = gdpictureImaging.BarcodeQRGetSize(data, encodingMode, errorCorrectionLevel, out version, quietZone, moduleSize);
     
        int imageID = gdpictureImaging.CreateNewGdPictureImage(size, size, 32, Color.White);
        gdpictureImaging.BarcodeQRWrite(imageID, data, encodingMode, errorCorrectionLevel, version, quietZone, moduleSize, 0, 0, 0, fillColor, backColor);
        gdpictureImaging.SaveAsPNG(imageID, "QrCode.png");
     
        // Release used resources.
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    See Also