关于如何解决canvas的画圆弧时的锯齿感以及如何让canvas的图更清晰?

let width = canvas.width,height=canvas.height;
if (window.devicePixelRatio) {
   canvas.style.width = width + "px";
   canvas.style.height = height + "px";
   canvas.height = height * window.devicePixelRatio;
   canvas.width = width * window.devicePixelRatio;
   ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
}

posted @ 2017-11-18 17:16  lyls  阅读(4712)  评论(0编辑  收藏  举报