Html canvas decreases the resolution of images and shapes. Is there a way by which we can increase the quality?
CodePudding user response:
Sure:
const width = ..., height = ..., scale = 2;
const canvas = document.querySelector('...')
canvas.style.width = width;
canvas.style.height = height;
canvas.width = width * scale;
canvas.height = height * scale;