댓글 : HTML5에서 간단한 원 코드를 공유하십시오.
<! doctype html> <head>
<meta charset = utf-8>
<title> html5 드로잉 서클 </title>
<script src = "<a href ="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js "> </script"> "> </script </a >>
</head>
<cript>
$ (document) .ready (function () {
var c = document.getElementById ( "drawbox");
var draw = c.getContext ( "2d"); // 2D 컨텐츠에 대한 참조를 얻고 도면 api </p> <p> draw.fillstyle = "Red"; // 색상을 호출하십시오.
draw.beginpath (); // 새 제품에서 그려집니다
draw.arc (50,50,50,0, Math.pi*2, True); // Center X 좌표 | 중심 Y 좌표 | 직경 | 직경 | Pi IS PI, Math.pi*2는 드로잉 원입니다 | 참으로 : 시계 반대 방향, 0은 시계 방향입니다.
draw.closepath (); // 끝
draw.fill ();
})
</스크립트>
</body>
<canvas> </canvas>
</body>
</html>
복제 다이어그램