How can I save a qrcode image?
I am making a website were users can generate a qrcode. Whenever a qrcode
is generated I want to save this image to a file and put the imagename in
a database. But I have no idea how I can save this. This is a ASP MVC 4
website but I am using JavaScript in my view to generate the qrcode. Here
for I am using the qrcode.js library.
JavaScript:
<script>
function makeCode() {
var qrcodeId = document.getElementById("QrcodeId");
var qrcode = new QRCode(document.getElementById("qrcode"), {
width: 100,
height: 100,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.H
});
qrcode.makeCode("http://localhost:50810/Profile/Qrcode?id=" + qrcodeId);
}
</script>
Html in my view:
<canvas id="qrcode"></canvas>
How do I save the qrcode image?
Thx!
No comments:
Post a Comment