원 안에 획을 그리는 쉬운 방법이 있습니까 (2 개의 원을 그리지 않고 유사한 해결 방법)? 이렇게하면 :
context.beginPath();
context.arc(200, 200, 93, Math.PI / 2, Math.PI, true);
context.fillStyle = '#FF6A6A';
context.fill();
context.lineWidth = 20;
context.strokeStyle = '#FF0000';
context.stroke();
나는 이것을 얻는다 :
스트로크는 내부에 필요하지만 부분적으로 그림 외부 (녹색 원으로 표시)를 그립니다.
선 너비를 보정하려면 반지름을 변경해야합니다.
context.beginPath();
context.arc(200, 200, 93, Math.PI / 2, Math.PI, true);
context.fillStyle = '#FF6A6A';
context.fill();
context.lineWidth = 20;
context.strokeStyle = '#FF0000';
context.beginPath();
// the radius of 93 - half the line width
context.arc(200, 200, 93-10, Math.PI / 2, Math.PI, true);
context.stroke();
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다