Created
October 17, 2018 18:48
-
-
Save imclint21/c0e2f22d68a6eb8a9c05508f6263e150 to your computer and use it in GitHub Desktop.
.NetCore make QrCode for bitcoin/cryptos address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Route("qr/{value}")] | |
public IActionResult Qr(string value) | |
{ | |
var memoryStream = new MemoryStream(); | |
var qrGenerator = new QRCodeGenerator(); | |
var qrCodeData = qrGenerator.CreateQrCode(value, QRCodeGenerator.ECCLevel.L); | |
var qrCode = new QRCode(qrCodeData); | |
qrCode.GetGraphic(20).Save(memoryStream, ImageFormat.Png); | |
return File(memoryStream.ToArray(), "image/png"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment