images can be send but are not drawn correctly

This commit is contained in:
2026-01-26 12:13:04 +01:00
parent 81026eae48
commit 8afb7cd747
3 changed files with 82 additions and 10 deletions
+21 -3
View File
@@ -16,17 +16,35 @@ const char index_html[] PROGMEM = R"rawliteral(
margin: 4px 2px;
cursor: pointer;
}
textarea {
width: 80%;
height: 200px;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>LED Panel Control</h1>
<button class="button" onclick="showPixels()">Show Pixels</button>
<button class="button" onclick="showSavedPixels()">Show Saved Pixels</button>
<br>
<textarea id="jsonInput" placeholder="Paste your JSON image data here..."></textarea>
<br>
<button class="button" onclick="uploadAndDraw()">Upload and Draw</button>
<script>
function showPixels() {
function showSavedPixels() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "/show", true);
xhr.open("GET", "/show-saved", true);
xhr.send();
}
function uploadAndDraw() {
var jsonData = document.getElementById("jsonInput").value;
var xhr = new XMLHttpRequest();
xhr.open("POST", "/upload", true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(jsonData);
}
</script>
</body>
</html>