Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfQRCodeGenerator - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfQRCodeGenerator

    Specifies all the properties for the QRCode to be rendered.

    Inheritance
    System.Object
    Syncfusion.Blazor.SfBaseComponent
    SfQRCodeGenerator
    Namespace: Syncfusion.Blazor.BarcodeGenerator
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfQRCodeGenerator : SfBaseComponent
    Examples
    <SfQRCodeGenerator Width="200" Height="200" Version="QRCodeVersion.Version40" Value="65213323"  BackgroundColor="white" ForeColor="black" OnValidationFailed="@OnInvalid">
     <QRCodeGeneratorDisplayText Text = "" Font="monospace" Size="25" Alignment="Alignment.Left" Position="TextPosition.Top">
        <QRCodeTextMargin Left = "0" Top="0" Right="0" Bottom="0"></QRCodeTextMargin>
     </QRCodeGeneratorDisplayText>
     <QRMargin Left = "10" Top="10" Right="10" Bottom="10"></QRMargin>
    </SfQRCodeGenerator>
    @code{
     public void OnInvalid(ValidationFailedEventArgs args)
     {
     }
    }

    Constructors

    SfQRCodeGenerator()

    Declaration
    public SfQRCodeGenerator()

    Properties

    BackgroundColor

    Specifies the background color of the QRCode. By default, it is set to white.

    Declaration
    public string BackgroundColor { get; set; }
    Property Value
    Type Description
    System.String

    ChildContent

    Sets content for QRCode generator element including HTML support and its customizations

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    DisplayText

    Specifies the text properties for the QRCode.

    Declaration
    public QRCodeGeneratorDisplayText DisplayText { get; set; }
    Property Value
    Type Description
    QRCodeGeneratorDisplayText

    EnablePersistence

    Enable or disable persisting component's state between page reloads.

    Declaration
    public bool EnablePersistence { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableRtl

    Enable or disable rendering component in right to left direction.

    Declaration
    public bool EnableRtl { get; set; }
    Property Value
    Type Description
    System.Boolean

    ErrorCorrectionLevel

    Specifies the error correction level of the QR code.

    Declaration
    public ErrorCorrectionLevel ErrorCorrectionLevel { get; set; }
    Property Value
    Type Description
    ErrorCorrectionLevel

    ForeColor

    Specifies the line and text color of the QRCode. By default, it is set to black.

    Declaration
    public string ForeColor { get; set; }
    Property Value
    Type Description
    System.String

    Height

    Specifies the height of the QRCode model. By default, it is set to 100%.

    Declaration
    public string Height { get; set; }
    Property Value
    Type Description
    System.String

    ID

    Specifies a unique SfQRCodeGenerator id.

    Declaration
    public string ID { get; set; }
    Property Value
    Type Description
    System.String

    Locale

    Overrides the global culture and localization value for this component. Default global culture is 'en-US'.

    Declaration
    public string Locale { get; set; }
    Property Value
    Type Description
    System.String

    Margin

    Specifies the margin properties for the QRCode. By default, it is set to 10 from all sides.

    Declaration
    public QRMargin Margin { get; set; }
    Property Value
    Type Description
    QRMargin

    Mode

    Specifies the QRCode rendering mode.

    Declaration
    public RenderingMode Mode { get; set; }
    Property Value
    Type Description
    RenderingMode

    OnValidationFailed

    Triggers when the QRCode input is an invalid string.

    Declaration
    public EventCallback<ValidationFailedEventArgs> OnValidationFailed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ValidationFailedEventArgs>

    Value

    Specifies the value of the QRCode to be rendered.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    System.String

    Version

    Specifies the version of the QR code.

    Declaration
    public QRCodeVersion Version { get; set; }
    Property Value
    Type Description
    QRCodeVersion

    Width

    Specifies the width of the QRCode model. By default, it is set to 100%.

    Declaration
    public string Width { get; set; }
    Property Value
    Type Description
    System.String

    XDimension

    Represents the width of the smallest element.

    Declaration
    public double XDimension { get; set; }
    Property Value
    Type Description
    System.Double

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    Export(String, BarcodeExportType)

    Export the barcode as an image in the specified image type and downloads it in the browser.

    Declaration
    public void Export(string fileName, BarcodeExportType exportType)
    Parameters
    Type Name Description
    System.String fileName

    Specifies the filename of the barcode image to be download.

    BarcodeExportType exportType

    Specifies the type used to export the barcode.

    ExportAsBase64Image(BarcodeExportType)

    Export the barcode as an image in the specified image type and returns it as base64 string.

    Declaration
    public Task<string> ExportAsBase64Image(BarcodeExportType exportType)
    Parameters
    Type Name Description
    BarcodeExportType exportType
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    Returns the base64 string value

    OnAfterRenderAsync(Boolean)

    The OnAfterRenderAsync method is invoked after the SfQRCodeGenerator component has finished rendering.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender

    The first time the component instance is rendered is set to true.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(System.Boolean)

    OnInitializedAsync()

    OnInitializedAsync is invoked when the SfQRCodeGenerator component is initialized.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.SfBaseComponent.OnInitializedAsync()

    OnParametersSetAsync()

    Sets the parameters for the SfQRCodeGenerator component in the render tree.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved