첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System;
using System.Collections.Generic;
using System.Drawing;

#region 다각형 그리기 - DrawPolygon(graphics, pen, originX, originY, radius, startDegree, intervalDegree)

/// <summary>
/// 다각형 그리기
/// </summary>
/// <param name="graphics">그래픽스 객체</param>
/// <param name="pen">펜</param>
/// <param name="originX">원점 X</param>
/// <param name="originY">원점 Y</param>
/// <param name="radius">반지름</param>
/// <param name="startDegree">시작 각도</param>
/// <param name="intervalDegree">간격 각도</param>
public void DrawPolygon
(
    Graphics graphics,
    Pen      pen,
    int      originX,
    int      originY,
    double   radius,
    double   startDegree,
    double   intervalDegree
)
{
    int polygonCount = Convert.ToInt32(360d / intervalDegree);

    List<Point> pointList = new List<Point>();

    for(double i = startDegree; i < startDegree + intervalDegree * polygonCount; i += intervalDegree)
    {
        pointList.Add(GetCirclePoint(originX, originY, radius, i)); // '원에서 특정 각도 포인트 구하기' 참조
    }

    graphics.DrawPolygon(pen, pointList.ToArray());
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요