This commit is contained in:
2dust
2024-10-19 14:30:14 +08:00
parent fe3836be14
commit 50449df08d
23 changed files with 93 additions and 60 deletions

View File

@@ -17,9 +17,15 @@ namespace v2rayN.Desktop.Views
private Bitmap? GetQRCode(string? url)
{
var qrCodeImage = QRCodeHelper.GenQRCode(url);
if (qrCodeImage is null) return null;
var ms = new MemoryStream(qrCodeImage);
var bytes = QRCodeHelper.GenQRCode(url);
return ByteToBitmap(bytes);
}
private Bitmap? ByteToBitmap(byte[]? bytes)
{
if (bytes is null) return null;
using var ms = new MemoryStream(bytes);
return new Bitmap(ms);
}
}