Skip to content

PixsysBE/Pixsys.Library.QrCode.QrCodeManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

QR Code Manager

This manager will create QR codes using SixLabors.ImageSharp

1. Installation

1.1 Register the service in Program.cs

using Pixsys.Library.QrCode.QrCodeManager;

var builder = WebApplication.CreateBuilder(args);

_ = builder.Services.AddQrCodeManager();

1.2 Usage

1.2.1 Inject the service into your controller

private readonly IQrCodeManager _qrCodeManager;

public MyController(IQrCodeManager qrCodeManager)
{
    _qrCodeManager = qrCodeManager;
}

1.2.2 Manager Methods

var destinationFolder = "path/to/folder";
await _qrCodeManager.GenerateAsync(new Pixsys.Library.QrCode.QrCodeManager.Models.GenerateQrCodeParameters
{
    Content = "Hello World !",
    Format = Pixsys.Library.Media.Common.Enums.ImageFormat.Webp,
    BackgroundColor = SixLabors.ImageSharp.Color.White,
    ForegroundColor = SixLabors.ImageSharp.Color.Black,
    Size = new SixLabors.ImageSharp.Size(200, 200),
    DestinationFolder = Directory.CreateDirectory(destinationFolder),
    DestinationFileName = "hello_world"
});

About

This manager will create QR codes using SixLabors.ImageSharp

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published