Skip to content

Instantly share code, notes, and snippets.

@imclint21
Created October 17, 2018 18:48
Show Gist options
  • Save imclint21/c0e2f22d68a6eb8a9c05508f6263e150 to your computer and use it in GitHub Desktop.
Save imclint21/c0e2f22d68a6eb8a9c05508f6263e150 to your computer and use it in GitHub Desktop.
.NetCore make QrCode for bitcoin/cryptos address
[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