📜  清除画布以进行重绘 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:49.877000             🧑  作者: Mango

代码示例1
//Given that canvas is a canvas element or an OffscreenCanvas object,

const context = canvas.getContext('2d');

context.clearRect(0, 0, canvas.width, canvas.height);