mirror of
https://github.com/javl/image2cpp.git
synced 2026-09-11 09:03:04 +00:00
Show the imported byte array image below the input field
This commit is contained in:
@@ -702,6 +702,17 @@ function handleTextInput(drawMode) {
|
||||
el.style.display = 'none';
|
||||
});
|
||||
checkImagesAvailable();
|
||||
|
||||
// Mirror the result onto a small preview canvas right below the
|
||||
// buttons, so the pasted array is visible without scrolling to step 3.
|
||||
const previewCanvas = document.getElementById('text-input-preview-canvas');
|
||||
previewCanvas.width = canvas.width;
|
||||
previewCanvas.height = canvas.height;
|
||||
previewCanvas.getContext('2d').drawImage(canvas, 0, 0);
|
||||
previewCanvas.style.display = 'block';
|
||||
|
||||
const readImagesNoteEl = document.getElementById('read-images-note');
|
||||
readImagesNoteEl.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user