1. 程式人生 > >微信小遊戲canvas抗鋸齒

微信小遊戲canvas抗鋸齒

這裡寫圖片描述

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

這裡寫圖片描述