test bits
This commit is contained in:
parent
875feccc63
commit
31b7aa72ed
1 changed files with 6 additions and 1 deletions
|
@ -119,6 +119,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const canvas = document.getElementById("canvas-input");
|
const canvas = document.getElementById("canvas-input");
|
||||||
|
const bits = document.getElementById("image-bits");
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
|
|
||||||
const pen = ctx.createImageData(2, 2);
|
const pen = ctx.createImageData(2, 2);
|
||||||
|
@ -131,7 +132,11 @@
|
||||||
|
|
||||||
var drawing = false;
|
var drawing = false;
|
||||||
canvas.onmousedown = function() { drawing = true; }
|
canvas.onmousedown = function() { drawing = true; }
|
||||||
document.onmouseup = function() { drawing = false; }
|
document.onmouseup = function() {
|
||||||
|
drawing = false;
|
||||||
|
// write image-bits for posting
|
||||||
|
bits.value = "101";
|
||||||
|
}
|
||||||
|
|
||||||
canvas.onmousemove = function() {
|
canvas.onmousemove = function() {
|
||||||
if (drawing) {
|
if (drawing) {
|
||||||
|
|
Reference in a new issue