본문 바로가기

web

HTML5 원 그리기



function drawCircle() {
     var canvas = document.getElementById("drawCCanvas");
     var context = canvas.getContext("2d");
     var left = (canvas.width - 200) * 0.5;
     var top = canvas.height * 0.1;
     var size = 200;
     context.beginPath();
     context.arc(left + size * 0.5, top + size * 0.5, size * 0.3, 0, Math.PI * 2, true);
     context.fillStyle = "salmon";
     context.fill();                   
}