(image, index)
| 17 | let imagesLoaded = 0 |
| 18 | |
| 19 | const drawImageOnCanvas = (image, index) => { |
| 20 | context.drawImage(image, 0, index * firstImage.height) |
| 21 | imagesLoaded++ |
| 22 | |
| 23 | if (imagesLoaded === images.length) { |
| 24 | filename = filename || "CodeBox-page" |
| 25 | canvas.toBlob(function (blob) { |
| 26 | saveAs( |
| 27 | blob, |
| 28 | `${filename}-${dayjs().format("YYYY-MM-DD HH:mm:ss")}.png` |
| 29 | ) |
| 30 | }) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | images.forEach((dataUrl, index) => { |
| 35 | const image = new Image() |