와우 에드온

분류없음 2008/12/22 14:53

Posted by yuiri

C# 으로 아날로그 시계

public partial class Form1 : Form
    {
        int baseX, baseY, clockW, clockH;

        public Form1()
        {
            InitializeComponent();
            baseX = 10; baseY = 10;
            clockW = 300; clockH = 300;

            this.Size = new Size(330, 350);
        }

        protected override void OnPaint(PaintEventArgs pea)
        {
            Graphics grfx = pea.Graphics;
            DrawAnalogClock(grfx);
        }

        private void DrawAnalogClock(Graphics g)
        {
            int center = baseX + clockH / 2;
            long seconds = DateTime.Now.Hour * 60 * 60 + DateTime.Now.Minute * 60 + DateTime.Now.Second; 

            double hourAngle = 2 * Math.PI * (seconds - 15 * 60 * 60) / (12 * 60 * 60);
            double minuteAngle = 2 * Math.PI * (seconds - 15 * 60) / (60 * 60);
            double secondAngle = 2 * Math.PI * (seconds - 15) / 60;

            g.DrawEllipse(new Pen(Brushes.Black, 3), baseX, baseY, clockW, clockH);
            g.DrawLine(new Pen(Brushes.Red, 7), center, center, center + (int)(100 * Math.Cos(hourAngle)), center + (int)(100 * Math.Sin(hourAngle)));
            g.DrawLine(new Pen(Brushes.Green, 5), center, center, center + (int)(130 * Math.Cos(minuteAngle)), center + (int)(130 * Math.Sin(minuteAngle)));
            g.DrawLine(new Pen(Brushes.Blue, 5), center, center, center + (int)(145 * Math.Cos(secondAngle)), center + (int)(145 * Math.Sin(secondAngle)));
            this.Text = "아날로그 시계: " + DateTime.Now.ToShortTimeString();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Invalidate();
        }

    }

Posted by yuiri

  • Member: Zarxrax
  • Title: 58008
  • Premiered: 2008-09-19
  • Categories:
    • Comedy
    • Fun
    • Romance
  • Song:
    • Ai Otsuka Ponpon
  • Anime:
  • Participation:
    • Anime Weekend Atlanta 14, AWA 14 Pro Contest (2008-09-19)
  • Comments: I spent two years making this video. I consider it to be a spiritual successor to The Fanservice Video, and I personally think it is one of my best works. It contains 300 different anime, which I believe is the largest number used in any AMV ever created (at least at the time of this writing).
    The actual amount of time spent editing the video was really quite small. The vast majority of effort went into searching through thousands upon thousands of episodes of anime looking for clips I could use, and then preparing those clips.
    I have created this video at 60 frames per second, which was necessary to achieve the look that I wanted. Some clips still look a little jerky though, which is really unfortunate, but there was nothing I could do about them.
    I tried to match up the visuals to the lyrics fairly well, and I even made a few visual puns in some places. Most of you wont notice this though, since the song is in Japanese.

    I just feel relieved to finally be finished with this, as it ended up taking me way longer to finish than I had anticipated. I think it turned out to be an awesome video though, and I hope you will find it to be as entertaining as I do.
  • Comment History: date (words) 2008-10-11 (250), 2008-10-09 (223), 2008-10-04 (212), 2008-09-23 (274)


    출처 : http://www.animemusicvideos.org/members/members_videoinfo.php?v=162704
             http://www.zshare.net/download/20294535136f0003/
  • Posted by yuiri