INNER CODE UNIT · TypeScript
changeImageFromNav
silvia-odwyer/photon · webpack_demo/src/index.ts:427
const changeImageFromNav = () => {
newimg.src = Underground;
newimg.onload = () => {
canvas.width = newimg.width;
canvas.height = newimg.height;
ctx.drawImage(newimg, 0, 0);
ensureBlendCanvasSize();
};
};
const setUpCanvas = () => {
const container = document.getElementById("image_container");
container?.appendChild(newimg);
canvas = document.getElementById("canvas") as HTMLCanvasElement;
canvas.width = newimg.width;
canvas.height = newimg.height;
const context = canvas.getContext("2d");