14 lines
371 B
C#
14 lines
371 B
C#
|
|
using QRCoder;
|
||
|
|
|
||
|
|
namespace MusicBridge.Agent.Network;
|
||
|
|
|
||
|
|
internal static class PairingQr
|
||
|
|
{
|
||
|
|
public static byte[] Render(ConnectionInvitation invitation)
|
||
|
|
{
|
||
|
|
using var data = QRCodeGenerator.GenerateQrCode(invitation.ToQrPayload(), QRCodeGenerator.ECCLevel.M);
|
||
|
|
using var renderer = new PngByteQRCode(data);
|
||
|
|
return renderer.GetGraphic(6);
|
||
|
|
}
|
||
|
|
}
|