예제 #1
0
        void Calac_Hour(double radus, List <CQClockData> datas, bool is_am = true, double offset = 0)
        {
            double angle = 0;

            for (int i = 0; i < 12; i++)
            {
                angle = i * 30;
                double      radain = Math.PI * angle / 180;
                float       x      = (float)(Math.Cos(radain) * radus);
                float       y      = (float)(Math.Sin(radain) * radus);
                CQClockData ckd    = datas[i];
                if (is_am == true)
                {
                    ckd.Value = (i + 3) % 12;
                    if (ckd.Value == 0)
                    {
                        ckd.Value = 12;
                    }
                }
                else
                {
                    ckd.Value = (i + 3) % 12;
                    if (ckd.Value != 0)
                    {
                        ckd.Value = ckd.Value + 12;
                    }
                }

                ckd.Left = x + radus + offset;
                ckd.Top  = y + radus + offset;
            }
        }
예제 #2
0
        void Calac_Min(double radus, List <CQClockData> datas, double offset = 0)
        {
            double angle = 0;

            for (int i = 0; i < 12; i++)
            {
                angle = i * 30;
                double      radain = Math.PI * angle / 180;
                float       x      = (float)(Math.Cos(radain) * radus);
                float       y      = (float)(Math.Sin(radain) * radus);
                CQClockData ckd    = datas[i];
                ckd.Value = ((i * 5) + 15) % 60;
                ckd.Left  = x + radus + offset;
                ckd.Top   = y + radus + offset;
            }
        }