첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
------------------------------------------------------------------------------------------------------------------------------------------------------
728x90
728x170

TestProject.zip
다운로드

▶ MainForm.cs

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace TestProject
{
    /// <summary>
    /// 메인 폼
    /// </summary>
    public partial class MainForm : Form
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainForm()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            #region 이벤트를 설정한다.

            Load                   += Form_Load;
            this.closeButton.Click += closeButton_Click;

            #endregion
        }

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Private
        //////////////////////////////////////////////////////////////////////////////// Event

        #region 폼 로드시 처리하기 - Form_Load(sender, e)

        /// <summary>
        /// 폼 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void Form_Load(object sender, EventArgs e)
        {
            PointF[] pointArray = new PointF[10];

            float centerX = (float)(ClientSize.Width  * 0.5 );
            float centerY = (float)(ClientSize.Height * 0.5 );
            float radius1 = (float)(ClientSize.Height * 0.45);
            float radius2 = (float)(ClientSize.Height * 0.25);
            float theta   = (float)(-Math.PI / 2);
            float dtheta  = (float)(2 * Math.PI / 10);

            for(int i = 0; i < 10; i += 2)
            {
                pointArray[i] = new PointF
                (
                    (float)(centerX + radius1 * Math.Cos(theta)),
                    (float)(centerY + radius1 * Math.Sin(theta))
                );

                theta += dtheta;

                pointArray[i + 1] = new PointF
                (
                    (float)(centerX + radius2 * Math.Cos(theta)),
                    (float)(centerY + radius2 * Math.Sin(theta))
                );

                theta += dtheta;
            }

            GraphicsPath graphicsPath = new GraphicsPath();

            graphicsPath.AddPolygon(pointArray);

            Region region = new Region(graphicsPath);

            Region = region;
        }

        #endregion
        #region 닫기 버튼 클릭시 처리하기 - closeButton_Click(sender, e)

        /// <summary>
        /// 닫기 버튼 클릭시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void closeButton_Click(object sender, EventArgs e)
        {
            Close();
        }

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