Skip to content

Commit 1743571

Browse files
committed
update add image output
1 parent 6605551 commit 1743571

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

samples/louie-drivers-license/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,16 @@ <h1 class="home-page-title">Read a Driver's License</h1>
8989

9090
const result = await scanner.launch();
9191
console.log(result);
92-
downloadImageFromBytes(result.originalImageResult.toBlob("image/png"), "photo.png", "image/png");
92+
result.originalImageResult.toCanvas().then(canvas => {
93+
// Optional: style or size the canvas
94+
canvas.style.maxWidth = "100%";
95+
canvas.style.display = "block";
96+
canvas.style.margin = "16px auto";
97+
98+
// Decide *where* it should live
99+
const container = document.querySelector(".parsed-result-view");
100+
container.prepend(canvas); // or appendChild
101+
});
93102

94103
if (result.barcodeResults.length > 0) {
95104
let processedResult;

0 commit comments

Comments
 (0)