handle image

This commit is contained in:
Sem van der Hoeven
2023-05-29 18:19:45 +02:00
parent 6e3e3dc022
commit c12f016545
3 changed files with 30 additions and 4 deletions

View File

@@ -127,6 +127,15 @@
function take_picture() {
console.log("take picture");
var xhr = new XMLHttpRequest();
xhr.open("GET", "/image", true);
xhr.overrideMimeType("text/plain; charset=utf-8");
xhr.onload = (e) => {
console.log("response image received");
const img = req.response;
document.getElementById("picture").src = "data:image/png;base64," + img;
}
xhr.send();
}
function arm_disarm() {