Search Results for

    Show / Hide Table of Contents

    Class QRCodeWriter

    A class allowing for advanced control on the generation of QR type barcodes.

    QRCodeWriter gives the developer access to set QR code error correction levels, and to add logo images to QR codes.

    Generated Barcodes can be exported as Images, Bitmaps, Files and Streams.

    Inheritance
    System.Object
    QRCodeWriter
    Namespace: IronBarCode
    Assembly: IronBarCode.dll
    Syntax
    public static class QRCodeWriter : Object

    QRCodeWriter generates QR codes with QR-specific options in C#, including version, error correction, and an embedded logo. Both members are static, so call QRCodeWriter.CreateQrCode(...) and a GeneratedBarcode comes back, ready to save as an image, stamp onto a PDF, or export as a data URL.

    CreateQrCode encodes a string, byte[], or Stream and accepts a size, a QRCodeWriter.QrErrorCorrectionLevel, and a qrVersion. The error-correction argument is what lets a code survive print wear or a partial cover, so raise it for labels that take physical handling. CreateQrCodeWithLogo does the same but also takes a QRCodeLogo, placing a brand mark in the center of the symbol and building in the extra correction a logo needs. For non-QR symbologies, or for a plain QR code without these options, use BarcodeWriter.CreateBarcode with BarcodeEncoding.QRCode instead. Because both methods return the same GeneratedBarcode, the choice of output format is made afterward and is independent of how the code was encoded.

    using IronBarCode;
    
    QRCodeWriter.CreateQrCode("https://ironsoftware.com", 500, QRCodeWriter.QrErrorCorrectionLevel.High)
        .SaveAsPng("qr.png");

    The create 2D barcodes how-to generates a QR code, and the custom QR code example applies version, error correction, and a logo.

    Methods

    CreateQrCode(Byte[], Int32, QRCodeWriter.QrErrorCorrectionLevel, Int32)

    Renders a QR code.

    Overload methods and methods of the created GeneratedBarcode object allow for barcode sizes and colors to be customized. Logos & Branding may also be added using the CreateQrCodeWithLogo method.

    Declaration
    public static GeneratedBarcode CreateQrCode(byte[] binaryData, int size = 500, QRCodeWriter.QrErrorCorrectionLevel errorCorrection, int qrVersion = 0)
    Parameters
    Type Name Description
    System.Byte[] binaryData

    The value of the QR code as a byte array.

    System.Int32 size

    The width and height of the QR code in pixels.

    QRCodeWriter.QrErrorCorrectionLevel errorCorrection

    The error correction level of the QR code.

    System.Int32 qrVersion

    The symbol version of the QR Code. The default value 0 will automatically assign an appropriate QR version for your data (highly recommended).

    Returns
    Type Description
    GeneratedBarcode

    A GeneratedBarcode object for the QR code which can be manipulated, annotated and saved to a System.Drawing.Image, an object, image file, PDF, MediaURL or data stream.

    CreateQrCode(Stream, Int32, QRCodeWriter.QrErrorCorrectionLevel, Int32)

    Renders a QR code.

    Overload methods and methods of the created GeneratedBarcode object allow for barcode sizes and colors to be customized. Logos & Branding may also be added using the CreateQrCodeWithLogo method.

    Declaration
    public static GeneratedBarcode CreateQrCode(Stream binaryDataStream, int size = 500, QRCodeWriter.QrErrorCorrectionLevel errorCorrection, int qrVersion = 0)
    Parameters
    Type Name Description
    System.IO.Stream binaryDataStream

    The value of the QR code as a stream.

    System.Int32 size

    The width and height of the QR code in pixels.

    QRCodeWriter.QrErrorCorrectionLevel errorCorrection

    The error correction level of the QR code.

    System.Int32 qrVersion

    The symbol version of the QR Code. The default value 0 will automatically assign an appropriate QR version for your data (highly recommended).

    Returns
    Type Description
    GeneratedBarcode

    A GeneratedBarcode object for the QR code which can be manipulated, annotated and saved to a System.Drawing.Image, an object, image file, PDF, MediaURL or data stream.

    CreateQrCode(String, Int32, QRCodeWriter.QrErrorCorrectionLevel, Int32)

    Renders a QR code from a String of data. UTF-8 fully supported.

    Overload methods and methods of the created GeneratedBarcode object allow for barcode sizes and colors to be customized. Logos / Branding may also be added.

    Declaration
    public static GeneratedBarcode CreateQrCode(string value, int size = 500, QRCodeWriter.QrErrorCorrectionLevel errorCorrection, int qrVersion = 0)
    Parameters
    Type Name Description
    System.String value

    The value of the QR code as a string. Also suitable for URLS.

    System.Int32 size

    The width and height of the QR code in pixels.

    QRCodeWriter.QrErrorCorrectionLevel errorCorrection

    The error correction level of the QR code.

    System.Int32 qrVersion

    The symbol version of the QR Code. The default value 0 will automatically assign an appropriate QR version for your data (highly recommended).

    Returns
    Type Description
    GeneratedBarcode

    A GeneratedBarcode object for the QR code which can be manipulated, annotated and saved to a System.Drawing.Image, an object, image file, PDF, MediaURL or data stream.

    CreateQrCodeWithLogo(Byte[], QRCodeLogo, Int32, Int32)

    Renders a QR code of given dimensions with a logo image at its center.

    Declaration
    public static GeneratedBarcode CreateQrCodeWithLogo(byte[] binaryData, QRCodeLogo qrCodeLogo, int size = 500, int qrVersion = 0)
    Parameters
    Type Name Description
    System.Byte[] binaryData

    The value of the QR code as a byte array.

    QRCodeLogo qrCodeLogo

    A QRCodeLogo class instance representing your desired logo image settings.

    System.Int32 size

    The width and height of the QR code in pixels.

    System.Int32 qrVersion

    The symbol version of the QR Code. The default value 0 will automatically assign an appropriate QR version for your data (highly recommended).

    Returns
    Type Description
    GeneratedBarcode

    A GeneratedBarcode object for the QR code which can be manipulated, annotated and saved to a System.Drawing.Image, an object, image file, PDF, MediaURL or data stream.

    CreateQrCodeWithLogo(Stream, QRCodeLogo, Int32, Int32)

    Renders a QR code of given dimensions with a logo image at its center.

    Declaration
    public static GeneratedBarcode CreateQrCodeWithLogo(Stream binaryDataStream, QRCodeLogo qrCodeLogo, int size = 500, int qrVersion = 0)
    Parameters
    Type Name Description
    System.IO.Stream binaryDataStream

    The value of the QR code as a stream.

    QRCodeLogo qrCodeLogo

    A QRCodeLogo class instance representing your desired logo image settings.

    System.Int32 size

    The width and height of the QR code in pixels.

    System.Int32 qrVersion

    The symbol version of the QR Code. The default value 0 will automatically assign an appropriate QR version for your data (highly recommended).

    Returns
    Type Description
    GeneratedBarcode

    A GeneratedBarcode object for the QR code which can be manipulated, annotated and saved to a System.Drawing.Image, an object, image file, PDF, MediaURL or data stream.

    CreateQrCodeWithLogo(String, QRCodeLogo, Int32, Int32)

    Renders a QR code of given dimensions with a logo image at its center.

    Declaration
    public static GeneratedBarcode CreateQrCodeWithLogo(string value, QRCodeLogo qrCodeLogo, int size = 500, int qrVersion = 0)
    Parameters
    Type Name Description
    System.String value

    The value of the QR code as a string. Also suitable for URLS.

    QRCodeLogo qrCodeLogo

    A QRCodeLogo class instance representing your desired logo image settings.

    System.Int32 size

    The width and height of the QR code in pixels.

    System.Int32 qrVersion

    The symbol version of the QR Code. The default value 0 will automatically assign an appropriate QR version for your data (highly recommended).

    Returns
    Type Description
    GeneratedBarcode

    A GeneratedBarcode object for the QR code which can be manipulated, annotated and saved to a System.Drawing.Image, an object, image file, PDF, MediaURL or data stream.

    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    %s requires a valid license key for further deployment. Get Trial Below.
    ironsuite
    Blue key in circleGet Started for Free
    30 days full access • No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet Started for Free
    The trial form was submitted successfully.
    Grey check in circleTrial key delivered
    Your key has been issued and sent to your email.
    Calendar in circleBook Free Live Demo
    No cards • no pitches • no commitments Pick a time for a quick, personalized demo
    Get the most out of your 30-day trial with:

    Live product and key features walk-through

    Project-specific recommendations

    All your questions answered

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation

    Want to deploy Iron Suite
    to a live project for FREE?

    What’s included?

    • Test in production without watermarks
    • 30 days fully functional product
    • 24/5 technical support during trial
    ironpdf Logo
    ironword Logo
    ironxl Logo
    ironppt Logo
    ironocr Logo
    ironbarcode Logo
    ironqr Logo
    ironprint Logo
    ironzip Logo
    ironwebscraper Logo
    Iron Software sales team
    Online 24/5
    Have Enterprise licensing requirements?
    Request Iron Suite Enterprise trial
    Key in blue circle

    Get your free 30-day Trial Key instantly

    Your trial license will be sent to your email address

    No limitations. 100% unlocked. No credit card.

    bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Or
    Key in blue circle

    Complete Your Trial Key Signup

    Tell us a little more about yourself.

    Key in blue circleNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
    Key in blue circle

    Your license key has been delivered to your inbox

    Can't find it? Check your spam folder.

    What’s next?
    Install with NuGet
    Add IronBarcode to your project
    Quickstart Guide
    Helpful resources to get started

    Need help getting started?

    Book a Free Live Demo

    See IronBarcode in action and get your licensing questions answered, or

    Key in blue circle

    Your demo request is in.

    You'll receive an invite via email shortly.

    What’s next?
    Explore Documentation
    Review Licensing Options
    badge_greencheck_in_yellowcircle
    Thank you
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronBarcode
    Your trial key should be in the email.
    If it is not, please contact support@ironsoftware.com