Canvas
Canvas
Canvas Size
인라인 속성
const canvas = document.querySelector('canvas');
const ctx = canvas.getContext('2d'); // canvas 2D 렌더링 컨텍스트
const canvasWidth = 300;
const canvasHeight = 300;
canvas.style.width = canvasWidth + 'px';
canvas.style.height = canvasHeight + 'px';
canvas.width = canvasWidth * 2;
canvas.height = canvasHeight * 2;DPR (Device Pixel Ratio)
원 그리기
beginPath()
closePath()
fill()
stroke()
arc()
clearRect(x, y, width, height)
Last updated