This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drawImage = async img_path => { | |
let canvas = document.createElement("canvas"); | |
canvas.src = img_path; | |
const context = canvas.getContext("2d"); | |
const img = await loadImage(img_path); | |
canvas.width = img.width; | |
canvas.height = img.height; | |
context.drawImage(img, 0, 0); |