Update index.php
This commit is contained in:
parent
6c47d7384f
commit
dca193a823
1 changed files with 6 additions and 7 deletions
13
index.php
13
index.php
|
@ -100,13 +100,12 @@
|
|||
const canvas = document.getElementById(canvasId);
|
||||
const ctx = canvas.getContext("2d");
|
||||
|
||||
// const pen = ctx.createImageData(2, 2);
|
||||
// for (let i = 0; i < pen.data.length; i += 4) {
|
||||
// pen.data[i] = 0;
|
||||
// pen.data[i+1] = 0;
|
||||
// pen.data[i+2] = 0;
|
||||
// pen.data[i+3] = 255;
|
||||
// }
|
||||
const copy = ctx.createImageData(128, 64);
|
||||
for (let i = 0; i < pen.data.length; i++) {
|
||||
copy.data[(i*4)+3] = 255;
|
||||
}
|
||||
|
||||
ctx.putImageData(copy, 0, 0);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
Reference in a new issue