예제 #1
0
        public void PaintThickHands(Device device, bool HourThick = true, bool MinuteThick = true,
                                    bool SecondsThick = false)
        {


            Point hourTop = device.Painter.HourHandLocation(device.Time.CurrentTime.Hour, device.Time.CurrentTime.Minute);
            Point minuteTop = device.Painter.MinuteHandLocation(device.Time.CurrentTime.Minute,
                                                                device.Time.CurrentTime.Second);
            Point secondTop = device.Painter.SecondHandLocation(device.Time.CurrentTime.Second);
            if (HourThick)
            {
                PaintBigHand(hourTop, Device.Center, device);
            }
            else
            {
                device.DrawingSurface.DrawLine(Color.White, 1, hourTop.X, hourTop.Y, Device.Center.X, Device.Center.Y);

            }
            if (MinuteThick)
            {
                PaintBigHand(minuteTop, Device.Center, device);
            }
            else
            {
                device.DrawingSurface.DrawLine(Color.White, 1, minuteTop.X, minuteTop.Y, Device.Center.X,
                                               Device.Center.Y);

            }
            if (SecondsThick)
            {
                PaintBigHand(secondTop, Device.Center, device);
            }
            else
            {
                device.DrawingSurface.DrawLine(Color.White, 1, secondTop.X, secondTop.Y, Device.Center.X,
                                               Device.Center.Y);
            }
            //fill
            if (HourThick)
            {
                PaintBigHand(hourTop, Device.Center, device, 1);
                PaintBigHand(hourTop, Device.Center, device, 0);
            }
            if (MinuteThick)
            {
                PaintBigHand(minuteTop, Device.Center, device, 1);
                PaintBigHand(minuteTop, Device.Center, device, 0);
            }
            if (SecondsThick)
            {
                PaintBigHand(secondTop, Device.Center, device, 1);
                PaintBigHand(secondTop, Device.Center, device, 0);
            }
            device.DrawingSurface.DrawEllipse(Color.White, 1, Device.Center.X, Device.Center.Y, 3, 3, Color.White, 0, 0,
                                              Color.White, 0, 0, 255);
            device.DrawingSurface.DrawEllipse(Color.White, 1, Device.Center.X, Device.Center.Y, 2, 2, Color.Black, 0, 0,
                                              Color.White, 0, 0, 255);

        }
예제 #2
0
        private void PaintBigHand(Point top, Point bottom, Device device, int width = 2)
        {

            //2 pixels wide for white hand

            Point hourBottomLeft = new Point(top.X - width, top.Y + width);
            Point hourTopLeft = new Point(top.X + width, top.Y - width);
            device.DrawingSurface.DrawLine(Color.White, 3, hourBottomLeft.X, hourBottomLeft.Y, hourTopLeft.X,
                                           hourTopLeft.Y);

            Point hourBottomRight = new Point(bottom.X - width, bottom.Y + width);
            Point hourTopRight = new Point(bottom.X + width, bottom.Y - width);
            device.DrawingSurface.DrawLine(Color.White, 1, hourBottomRight.X, hourBottomRight.Y, hourTopRight.X,
                                           hourTopRight.Y);

            device.DrawingSurface.DrawLine(Color.White, 1, hourBottomLeft.X, hourBottomLeft.Y, hourBottomRight.X,
                                           hourBottomRight.Y);
            device.DrawingSurface.DrawLine(Color.White, 1, hourTopLeft.X, hourTopLeft.Y, hourTopRight.X, hourTopRight.Y);



            
        }
예제 #3
0
        public void PaintSkinnyHands(Device device)
        {
            device.Painter.PaintHourHand(Color.White, 3, device.Time.CurrentTime.Hour, device.Time.CurrentTime.Minute);
            device.Painter.PaintMinuteHand(Color.White, 2, device.Time.CurrentTime.Minute,
                                           device.Time.CurrentTime.Second);
            device.Painter.PaintSecondHand(Color.White, 1, device.Time.CurrentTime.Second);

            device.DrawingSurface.DrawEllipse(Color.White, 1, Device.Center.X, Device.Center.Y, 3, 3, Color.White, 0, 0,
                                  Color.White, 0, 0, 255);
            device.DrawingSurface.DrawEllipse(Color.White, 1, Device.Center.X, Device.Center.Y, 2, 2, Color.Black, 0, 0,
                                              Color.White, 0, 0, 255);

        }