Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleImageRect(canvas) {
const image = new CanvasImage(canvas);
canvas.width = 100;
canvas.height = 100;
const context = canvas.getContext('2d');
image.src = 'https://upload.wikimedia.org/wikipedia/commons/6/63/Biho_Takashi._Bat_Before_the_Moon%2C_ca._1910.jpg';
image.addEventListener('load', () => {
context.drawImage(image, 0, 0, 100, 100);
});
}
handleEmbedHTML(canvas) {
const image = new CanvasImage(canvas);
canvas.width = 100;
canvas.height = 100;
const context = canvas.getContext('2d');
const htmlString = '<b>Hello, World!</b>';
const svgString = `
<svg height="200" width="200" xmlns="http://www.w3.org/2000/svg">
</svg>