Class QRCodeLogo
The QRCodeLogo class represents a logo image that can be used in a QR code. It can be initialized with an image size and image path, a base64-encoded image, an online image URL, or an icon.
Inherited Members
Namespace: Syncfusion.Blazor.BarcodeGenerator
Assembly: Syncfusion.Blazor.dll
Syntax
public class QRCodeLogo : SfBaseComponent
Examples
The following example demonstrates how to use the QRCodeLogo
component in Razor syntax:
<SfQRCodeGenerator Width="150px" Height="150px" Value="Syncfusion">
<QRCodeLogo Width="50" Height="50" ImageSource="images/syncfusion.png"></QRCodeLogo>
</SfQRCodeGenerator>
Constructors
QRCodeLogo()
Declaration
public QRCodeLogo()
Properties
Height
Gets or sets the height of the image displayed in the center of the QR code.
Declaration
public double Height { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is one-third of the QR code height. |
Remarks
The image size should be equal to or less than 30% of the QR code's height. If the specified height exceeds 30%, the QR code may not be scanned properly. Therefore, the lesser value between 30% of the QR code's height and the specified height will be used for rendering.
Examples
The following example demonstrates how to set the image height for the QR code in Razor syntax:
<SfQRCodeGenerator Width="150px" Height="150px" Value="Syncfusion">
<QRCodeLogo Width="50" Height="50" ImageSource="images/syncfusion.png"></QRCodeLogo>
</SfQRCodeGenerator>
ImageSource
Gets or sets the image source that will be displayed in the center of the QR code.
Declaration
public string ImageSource { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the image source. The default value is |
Remarks
The logo can be specified as an image path, a base64-encoded image, an online image URL, or an icon.
Examples
The following example demonstrates how to set the image source for the QR code in Razor syntax:
<SfQRCodeGenerator Width="150px" Height="150px" Value="Syncfusion">
<QRCodeLogo ImageSource="images/syncfusion.png"></QRCodeLogo>
</SfQRCodeGenerator>
Width
Gets or sets the width of the image displayed in the center of the QR code.
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is one-third of the QR code width. |
Remarks
The image size should be equal to or less than 30% of the QR code's width. If the specified width exceeds 30%, the QR code may not be scanned properly. Therefore, the lesser value between 30% of the QR code's width and the specified width will be used for rendering.
Examples
The following example demonstrates how to set the image width for the QR code in Razor syntax:
<SfQRCodeGenerator Width="150px" Height="150px" Value="Syncfusion">
<QRCodeLogo Width="50" Height="50" ImageSource="images/syncfusion.png"></QRCodeLogo>
</SfQRCodeGenerator>
Methods
OnInitializedAsync()
OnInitializedAsync is invoked when the component is initialized.
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
OnParametersSetAsync()
Sets the parameters for the QRCodeLogo component in the render tree.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |