微信小游戏canvas抗锯齿

版权声明:转载的时候提到我就行…… https://blog.csdn.net/SakuraLLj/article/details/80263494

这里写图片描述

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);

这里写图片描述

猜你喜欢

转载自blog.csdn.net/SakuraLLj/article/details/80263494
今日推荐