Porównaj commity

...

3 Commity

Autor SHA1 Wiadomość Data
Hugh Chen a66bc5d512 Fix icon and clear image context in case multiple images are uploaded 2022-02-02 17:52:53 -08:00
Hugh Chen ebad938479 Swap x and y and update demos 2022-02-02 17:42:32 -08:00
Hugh Chen 661207da07 Reformat 2022-02-02 17:30:46 -08:00
7 zmienionych plików z 15 dodań i 6 usunięć

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 369 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 384 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 39 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 38 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 87 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 96 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 73 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 73 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 264 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 264 KiB

Wyświetl plik

@ -10,7 +10,7 @@
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="icon" href="./demo.png" />
<link rel="icon" href="./images/demo_squid.png" />
</head>
<title>QRImage</title>
@ -172,7 +172,12 @@
</div>
<div class="center">
<p>*Note that these QR codes may not work with every QR code reader, so be sure to test them first. If you are having trouble getting them to read, you may want to increase the bit size.</p>
<p>
*Note that these QR codes may not work with every QR code
reader, so be sure to test them first. If you are having
trouble getting them to read, you may want to increase the
bit size.
</p>
</div>
<br />

Wyświetl plik

@ -7,8 +7,11 @@ imageLoader.addEventListener("change", handleImage, false);
var uploadCanvas = document.getElementById("imageCanvas");
var uploadContext = uploadCanvas.getContext("2d");
uploadCanvas.width = 200;
uploadCanvas.height = 200;
uploadWidth = 200;
uploadHeight = 200;
uploadCanvas.width = uploadWidth;
uploadCanvas.height = uploadHeight;
img = false;
@ -17,7 +20,8 @@ function handleImage(e) {
reader.onload = function (event) {
img = new Image();
img.onload = function () {
uploadContext.drawImage(img, 0, 0, 200, 200);
uploadContext.clearRect(0, 0, uploadWidth, uploadHeight);
uploadContext.drawImage(img, 0, 0, uploadWidth, uploadHeight);
};
img.src = event.target.result;
};
@ -235,8 +239,8 @@ function makeCode() {
}
drawShape(
ctx,
i + borderSizeValue,
j + borderSizeValue,
i + borderSizeValue,
bitLength,
radiusRatio,
QRLength