예제 #1
0
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            System.Drawing.Point[] DropPoints =
            {
                new Point(0,  0),
                new Point(11, 0),
                new Point(5, 6)
            };
            System.Drawing.Point[] ClosePoints =
            {
                new Point(0,  0),
                new Point(2,  0),
                new Point(5,  3),
                new Point(8,  0),
                new Point(10, 0),
                new Point(6,  4),
                new Point(10, 8),
                new Point(8,  8),
                new Point(5,  5),
                new Point(2,  8),
                new Point(0,  8),
                new Point(4, 4)
            };
            Rectangle rec = new Rectangle();

            rec.Size = new Size(this.Width - 1, this.Height - 1);
            if (m_hot)
            {
                e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias;
                e.Graphics.FillRectangle(new Drawing2D.LinearGradientBrush(new Point(0, 0), new Point(0, this.Height), RenderColors.ControlButtonBackHighColor(m_RenderMode, m_BackHighColor), RenderColors.ControlButtonBackLowColor(m_RenderMode, m_BackLowColor)), rec);
                e.Graphics.DrawRectangle(new Pen(RenderColors.ControlButtonBorderColor(m_RenderMode, m_BorderColor)), rec);
                e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.Default;
            }
            Drawing2D.GraphicsPath g = new Drawing2D.GraphicsPath();
            Drawing2D.Matrix       m = new Drawing2D.Matrix();
            int x = (this.Width - 11) / 2;
            int y = (this.Height - 11) / 2 + 1;

            if (m_style == ButtonStyle.Drop)
            {
                e.Graphics.FillRectangle(new SolidBrush(ForeColor), x, y, 11, 2);
                g.AddPolygon(DropPoints);
                m.Translate(x, y + 3);
                g.Transform(m);
                e.Graphics.FillPolygon(new SolidBrush(ForeColor), g.PathPoints);
            }
            else
            {
                g.AddPolygon(ClosePoints);
                m.Translate(x, y);
                g.Transform(m);
                e.Graphics.DrawPolygon(new Pen(ForeColor), g.PathPoints);
                e.Graphics.FillPolygon(new SolidBrush(ForeColor), g.PathPoints);
            }
            g.Dispose();
            m.Dispose();
        }
    protected override void WndProc(ref Message m)
    {
        base.WndProc(m);

        switch (m.Msg)
        {
        case 0xf:
            //Paint the background. Only the borders
            //will show up because the edit
            //box will be overlayed
            Graphics g = this.CreateGraphics;
            Pen      p = new Pen(Color.White, 2);
            g.FillRectangle(BorderBrush, this.ClientRectangle);

            //Draw the background of the dropdown button
            Rectangle rect = new Rectangle(this.Width - 15, 3, 12, this.Height - 6);
            g.FillRectangle(DropButtonBrush, rect);

            //Create the path for the arrow
            Drawing2D.GraphicsPath pth = new Drawing2D.GraphicsPath();
            PointF TopLeft             = new PointF(this.Width - 13, (this.Height - 5) / 2);
            PointF TopRight            = new PointF(this.Width - 6, (this.Height - 5) / 2);
            PointF Bottom = new PointF(this.Width - 9, (this.Height + 2) / 2);
            pth.AddLine(TopLeft, TopRight);
            pth.AddLine(TopRight, Bottom);

            g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality;

            //Determine the arrow's color.
            if (this.DroppedDown)
            {
                ArrowBrush = new SolidBrush(SystemColors.HighlightText);
            }
            else
            {
                ArrowBrush = new SolidBrush(SystemColors.ControlText);
            }

            //Draw the arrow
            g.FillPath(ArrowBrush, pth);

            break;

        default:
            break;                     // TODO: might not be correct. Was : Exit Select

            break;
        }
    }
 public void FillPath(Brush b, Drawing2D.GraphicsPath roundrect)
 {
     g.FillPath(b, roundrect);
 }
 public void FillPath(SolidBrush b, Drawing2D.GraphicsPath graphicsPath)
 {
     g.FillPath(b, graphicsPath);
 }
    protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
    {
        base.OnPaint(e);
        float multEllipse = 0.4f;
        float diffHeight  = 0.05f * this.Height;
        //25%
        float diffWidth = 0.1f * this.Width;

        using (Graphics g = e.Graphics) {
            g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias;


            switch (BooleanControlStyle)
            {
            case BooleanControlStyles.Rounded:
                Pen        border     = new Pen(Brushes.Silver);
                SolidBrush _backColor = new SolidBrush(Color.Aquamarine);
                switch (_value)
                {
                case true:
                    //paint green
                    _backColor.Color = Color.LimeGreen;
                    border           = new Pen(Brushes.LimeGreen);
                    break;

                case false:
                    //paint gray
                    _backColor.Color = Color.WhiteSmoke;
                    //gainsboro , lightgray
                    border = new Pen(Brushes.Silver);
                    break;
                }
                //draw background
                g.FillEllipse(_backColor, new Rectangle(new Point(diffWidth / 2f, diffHeight / 2f), new Size(this.Width * multEllipse, this.Height - diffHeight)));
                g.FillEllipse(_backColor, new Rectangle(new Point(this.Width - this.Width * multEllipse - diffWidth / 2f, diffHeight / 2f), new Size(this.Width * multEllipse, this.Height - diffHeight)));
                g.FillRectangle(_backColor, new Rectangle(new Point(this.Width * (multEllipse / 2f) + diffWidth / 2f, diffHeight / 2f), new Size(this.Width * (1f - multEllipse) - diffWidth, this.Height - diffHeight)));
                //draw border
                Rectangle rectEllipse = new Rectangle(new Point(diffWidth / 2f, diffHeight / 2f), new Size(this.Width * multEllipse, this.Height - diffHeight));
                g.DrawArc(border, rectEllipse, 180, 90);
                //upper left
                g.DrawArc(border, rectEllipse, 90, 90);
                //bottom left

                rectEllipse.Location = new Point(this.Width * (1f - multEllipse) - diffWidth / 2f, diffHeight / 2f);

                g.DrawArc(border, rectEllipse, 270, 90);
                //upper right
                g.DrawArc(border, rectEllipse, 0, 90);
                //bottom right

                g.DrawLine(border, new Point(diffWidth / 2f + this.Width * multEllipse * 0.5f, diffHeight / 2f), new Point(this.Width - diffWidth / 2f - this.Width * multEllipse * 0.5f, diffHeight / 2f));
                //línea superior
                g.DrawLine(border, new Point(diffWidth / 2f + this.Width * multEllipse * 0.5f, this.Height - diffHeight / 2f + 0), new Point(this.Width - diffWidth / 2f - this.Width * multEllipse * 0.5f, this.Height - diffHeight / 2f + 0));
                //línea inferior


                border.Dispose();
                _backColor.Dispose();

                Pen border1 = null;
                switch (Value)
                {
                case false:
                    border1 = new Pen(Brushes.Silver);
                    break;

                case true:
                    border1 = new Pen(Brushes.LimeGreen);
                    break;
                }

                g.FillEllipse(new SolidBrush(Color.WhiteSmoke), Rectangle);
                g.DrawEllipse(border1, Rectangle);
                border.Dispose();
                break;

            case BooleanControlStyles.SquareText:

                SolidBrush backBase = new SolidBrush(Color.DarkGray);
                //With {.Color = Color.FromArgb(128, Color.Silver)}
                SolidBrush backSmallBase = new SolidBrush(Color.FromArgb(backBase.Color.R * 0.9f, backBase.Color.G * 0.9f, backBase.Color.B * 0.9f));
                SolidBrush backTextBox   = new SolidBrush(Color.DarkGray);

                float     widthBox     = 0.6f;
                Rectangle RectBox      = new Rectangle(Point.Empty, new Size(this.Width * widthBox, this.Height - 2));
                Rectangle RectSmallBox = new Rectangle(new Point((this.Width - this.Width * 0.7f) / 2f, RectBox.Height * 0.25f + 1), new Size(this.Width * 0.7f, RectBox.Height / 2f));

                SolidBrush bruSuperiorLine = null;
                SolidBrush bruInferiorLine = null;

                switch (Value)
                {
                case false:
                    backBase.Color    = Color.FromArgb(255, Color.DarkGray);
                    backTextBox.Color = Color.FromArgb(255, Color.Firebrick);
                    RectBox.Location  = new Point(0, 1);
                    bruSuperiorLine   = new SolidBrush(Color.FromArgb(255, Color.IndianRed));
                    bruInferiorLine   = new SolidBrush(Color.FromArgb(255, Color.DarkRed));
                    break;

                case true:
                    backBase.Color = Color.FromArgb(255, Color.DarkGray);
                    //forestgreen
                    backTextBox.Color = Color.FromArgb(255, Color.ForestGreen);
                    RectBox.Location  = new Point(this.Width * (1f - widthBox), 1);
                    bruSuperiorLine   = new SolidBrush(Color.FromArgb(255, Color.LimeGreen));
                    bruInferiorLine   = new SolidBrush(Color.FromArgb(255, Color.DarkGreen));
                    break;
                }

                //draw gray background
                int BorderSpacing = this.Height * 0.1f;
                Drawing2D.GraphicsPath pathBack = new Drawing2D.GraphicsPath(Drawing2D.FillMode.Alternate);
                pathBack.AddLines({
                    new Point(0 + BorderSpacing, 0),
                    new Point(this.Width - 1 - BorderSpacing, 0),
                    new Point(this.Width - 1, BorderSpacing),
                    new Point(this.Width - 1, this.Height - 1 - BorderSpacing),
                    new Point(this.Width - 1 - BorderSpacing, this.Height - 1),
                    new Point(0 + BorderSpacing, this.Height - 1),
                    new Point(0, this.Height - BorderSpacing),
                    new Point(0, BorderSpacing),
                    new Point(0 + BorderSpacing, 0)
                });

                float BorderSpacing2             = BorderSpacing / 2f;
                Drawing2D.GraphicsPath pathSmall = new Drawing2D.GraphicsPath();
                pathSmall.AddLines({
                    new Point(RectSmallBox.Location.X + BorderSpacing2, RectSmallBox.Location.Y),
                    new Point(RectSmallBox.Location.X + RectSmallBox.Width - BorderSpacing2, RectSmallBox.Location.Y),
                    new Point(RectSmallBox.Location.X + RectSmallBox.Width, RectSmallBox.Y + BorderSpacing2),
                    new Point(RectSmallBox.Location.X + RectSmallBox.Width, RectSmallBox.Location.Y + RectSmallBox.Height - BorderSpacing2),
                    new Point(RectSmallBox.Location.X + RectSmallBox.Width - BorderSpacing2, RectSmallBox.Location.Y + RectSmallBox.Height),
                    new Point(RectSmallBox.Location.X + BorderSpacing2, RectSmallBox.Location.Y + RectSmallBox.Height),
                    new Point(RectSmallBox.Location.X, RectSmallBox.Location.Y + RectSmallBox.Height - BorderSpacing2),
                    new Point(RectSmallBox.Location.X, RectSmallBox.Location.Y + BorderSpacing2),
                    new Point(RectSmallBox.Location.X + BorderSpacing2, RectSmallBox.Location.Y)
                });
예제 #6
0
    private void BuildMe(EDIR BodyDir)
    {
        try {
            SzChInternaly = true;
            Drawing2D.GraphicsPath gr = new Drawing2D.GraphicsPath();
            switch (BodyDir)
            {
            case EDIR.Horizontal:
                this.Size = new Size(this.Width, _BorderWidth + 10);
                gr.AddRectangle(new Rectangle(0, (-_BorderWidth + this.Height) / 2, this.Width, _BorderWidth));
                break;

            case EDIR.Vertical:
                this.Size = new Size(_BorderWidth + 10, this.Height);
                gr.AddRectangle(new Rectangle((-_BorderWidth + this.Width) / 2, 0, _BorderWidth, this.Height));
                break;

            case EDIR.Slash:
                try {
                    // CType(_BorderWidth * Height / Width, Integer)
                    for (i = 0; i <= Convert.ToInt32(Math.Pow(Math.Pow(Width, 2) + Math.Pow(Height, 2), 0.5)); i += _BorderWidth)
                    {
                        switch (_DrawStyle)
                        {
                        case eStyle.circ:
                            gr.AddPie(i, Convert.ToInt32(Height * i / Width), _BorderWidth, _BorderWidth, 0, 360);
                            break;

                        case eStyle.rect:
                            gr.AddRectangle(new Rectangle(i, Convert.ToInt32(Height * i / Width), _BorderWidth, _BorderWidth));
                            break;
                        }
                    }
                } catch {
                }
                break;

            case EDIR.BKSlash:
                try {
                    // CType(_BorderWidth * Height / Width, Integer)
                    for (i = 0; i <= Convert.ToInt32(Math.Pow(Math.Pow(this.Height, 2) + Math.Pow(this.Width, 2), 0.5)); i += _BorderWidth)
                    {
                        switch (_DrawStyle)
                        {
                        case eStyle.circ:
                            gr.AddPie(Width - 1 - i, Convert.ToInt32(Height * i / Width), _BorderWidth, _BorderWidth, 0, 360);
                            break;

                        case eStyle.rect:
                            gr.AddRectangle(new Rectangle(Width - 1 - i, Convert.ToInt32(Height * i / Width), _BorderWidth, _BorderWidth));
                            break;
                        }
                    }
                } catch {
                }
                break;
            }
            this.Region   = new Region(gr);
            SzChInternaly = false;
        } catch {
        }
    }
예제 #7
0
    private void DrawClock(Bitmap Bitmap, bool DrawHands = true)
    {
        Graphics Graphic    = Graphics.FromImage(Bitmap);
        Font     Clock_Font = frmOptions.P3.Font;

        // For Perfect Picture (Not Important)
        if (frmOptions.rdbHigh.Checked == true)
        {
            Graphic.PixelOffsetMode    = Drawing2D.PixelOffsetMode.HighQuality;
            Graphic.TextRenderingHint  = Drawing.Text.TextRenderingHint.ClearTypeGridFit;
            Graphic.InterpolationMode  = Drawing2D.InterpolationMode.HighQualityBicubic;
            Graphic.SmoothingMode      = Drawing2D.SmoothingMode.HighQuality;
            Graphic.CompositingQuality = Drawing2D.CompositingQuality.AssumeLinear;
        }

        // Adjusting the gradient location points.
        Clk_Gradient.Positions = new[] { 0.0F, 0.1F, 0.3F, 0.4F, 0.5F, 0.6F, 0.7F, 0.8F, 1.0F };
        // Adjusting the gradient colors through 9 points, where 0.0F is the first color entirly, and 1.0F is the second color.
        Clk_Gradient.Factors = new[] { 0.0F, 0.2F, 0.5F, 0.7F, 1.0F, 0.7F, 0.5F, 0.2F, 0.0F };
        // ---------------------------------------------------------------------------
        // Draw Analog Clock Background

        // This should be possible to change later
        Rectangle rect = new Rectangle(0, 0, 200, 200);

        // Defines the brush to drow the gradient
        Drawing2D.LinearGradientBrush lgb;
        // Sets the gradient angle.
        Console.WriteLine(frmOptions.Mode.ToString);
        if (frmOptions.rdbAngle.Checked)
        {
            lgb = new Drawing2D.LinearGradientBrush(rect, Used_Color.Analog_Color1, Used_Color.Analog_Color2, frmOptions.Angle.Value);
        }
        else
        {
            lgb = new Drawing2D.LinearGradientBrush(rect, Used_Color.Analog_Color1, Used_Color.Analog_Color2, frmOptions.Mode);
        }
        lgb.Blend = Clk_Gradient;

        // fills the outer part of the clock
        if (Square)
        {
            Graphic.FillRectangle(lgb, rect);
        }
        else
        {
            Graphic.FillEllipse(lgb, rect);
        }

        rect = new Rectangle(10, 10, 180, 180);

        // fills the inverted part of the clock (the part that appears to 'pop' out)
        lgb.LinearColors = new Color[] { Used_Color.Analog_Color2, Used_Color.Analog_Color1 };
        if (Square)
        {
            Graphic.FillRectangle(lgb, rect);
        }
        else
        {
            Graphic.FillEllipse(lgb, rect);
        }


        // Uses some calculators to return something similar to (13,13,174,174)
        rect.X += 3; rect.Y += 3; rect.Width -= 2 * 3; rect.Height -= 2 * 3;
        // fills the rest of the clock
        lgb.LinearColors = new Color[] { Used_Color.Analog_Color1, Used_Color.Analog_Color2 };
        if (Square)
        {
            Graphic.FillRectangle(lgb, rect);
        }
        else
        {
            Graphic.FillEllipse(lgb, rect);
        }

        // ---------------------------------------------------------------------------

        // Draw Analog Clock Numbers Background

        Drawing2D.GraphicsPath path = new Drawing2D.GraphicsPath();

        // Uses some calculators to return something similar to (20,20,160,160)
        Rectangle a = new Rectangle(20, 20, 160, 160);
        // Uses some calculators to return something similar to (40,40,120,120)
        Rectangle b = new Rectangle(40, 40, 120, 120);

        if (Square)
        {
            path.AddRectangle(a);
            path.AddRectangle(b);
        }
        else
        {
            path.AddEllipse(a);
            path.AddEllipse(b);
        }


        Graphic.FillPath(new SolidBrush(Color.FromArgb(frmOptions.Alpha.Value, Used_Color.Analog_NumberBackColor)), path);
        // ---------------------------------------------------------------------------

        // Draw Numbers

        SolidBrush sbW = new SolidBrush(Used_Color.Analog_NumberColor);

        if (HideName == false)
        {
            using (Font TheFont = new Font("Arial", 9.0F, FontStyle.Bold))
            {
                Graphic.DrawString("Megadardery", TheFont, sbW, 62, 130);
            }
        }
        if (Square)
        {
            if (frmOptions.rdb1st.Checked)
            {
                Graphic.DrawString("1", Clock_Font, sbW, (130 + X + One.X), (20 + Y + One.Y));
                Graphic.DrawString("2", Clock_Font, sbW, (161 + X + Two.X), (55 + Y + Two.Y));
                Graphic.DrawString("3", Clock_Font, sbW, (162 + X + Three.X), (90 + Y + Three.Y));
                Graphic.DrawString("4", Clock_Font, sbW, (161 + X + Four.X), (125 + Y + Four.Y));
                Graphic.DrawString("5", Clock_Font, sbW, (130 + X + Five.X), (157 + Y + Five.Y));
                Graphic.DrawString("6", Clock_Font, sbW, (93 + X + Six.X), (160 + Y + Six.Y));
                Graphic.DrawString("7", Clock_Font, sbW, (55 + X + Seven.X), (157 + Y + Seven.Y));
                Graphic.DrawString("8", Clock_Font, sbW, (23 + X + Eight.X), (125 + Y + Eight.Y));
                Graphic.DrawString("9", Clock_Font, sbW, (23 + X + Nine.X), (90 + Y + Nine.Y));
                Graphic.DrawString("10", Clock_Font, sbW, (20 + X + Ten.X), (55 + Y + Ten.Y));
                Graphic.DrawString("11", Clock_Font, sbW, (55 + X + Eleven.X), (20 + Y + Eleven.Y));
                Graphic.DrawString("12", Clock_Font, sbW, (89 + X + Twelve.X), (20 + Y + Twelve.Y));
            }
            else if (frmOptions.rdb2nd.Checked)
            {
                Font Clock_Font_Other = new Font("Bodoni MT Poster Compressed", 11.0F, FontStyle.Bold);
                Graphic.DrawString("I", Clock_Font_Other, sbW, (133 + X + One.X), (20 + Y + One.Y));
                Graphic.DrawString("II", Clock_Font_Other, sbW, (164 + X + Two.X), (55 + Y + Two.Y));
                Graphic.DrawString("III", Clock_Font_Other, sbW, (165 + X + Three.X), (90 + Y + Three.Y));
                Graphic.DrawString("IV", Clock_Font_Other, sbW, (164 + X + Four.X), (125 + Y + Four.Y));
                Graphic.DrawString("V", Clock_Font_Other, sbW, (133 + X + Five.X), (160 + Y + Five.Y));
                Graphic.DrawString("VI", Clock_Font_Other, sbW, (96 + X + Six.X), (160 + Y + Six.Y));
                Graphic.DrawString("VII", Clock_Font_Other, sbW, (58 + X + Seven.X), (159 + Y + Seven.Y));
                Graphic.DrawString("VIII", Clock_Font_Other, sbW, (21 + X + Eight.X), (125 + Y + Eight.Y));
                Graphic.DrawString("IX", Clock_Font_Other, sbW, (25 + X + Nine.X), (90 + Y + Nine.Y));
                Graphic.DrawString("X", Clock_Font_Other, sbW, (25 + X + Ten.X), (55 + Y + Ten.Y));
                Graphic.DrawString("XI", Clock_Font_Other, sbW, (58 + X + Eleven.X), (20 + Y + Eleven.Y));
                Graphic.DrawString("XII", Clock_Font_Other, sbW, (92 + X + Twelve.X), (20 + Y + Twelve.Y));
            }
            else
            {
                Graphic.DrawString("_", Clock_Font, sbW, (162 + X + Three.X), (85 + Y + Three.Y));
                Graphic.DrawString("|", Clock_Font, sbW, (95 + X + Six.X), (160 + Y + Six.Y));
                Graphic.DrawString("_", Clock_Font, sbW, (23 + X + Nine.X), (85 + Y + Nine.Y));
                Graphic.DrawString("|", Clock_Font, sbW, (95 + X + Twelve.X), (20 + Y + Twelve.Y));
            }
        }
        else if (frmOptions.rdb1st.Checked)
        {
            Graphic.DrawString("1", Clock_Font, sbW, (130 + X + One.X), (30 + Y + One.Y));
            Graphic.DrawString("2", Clock_Font, sbW, (153 + X + Two.X), (55 + Y + Two.Y));
            Graphic.DrawString("3", Clock_Font, sbW, (162 + X + Three.X), (90 + Y + Three.Y));
            Graphic.DrawString("4", Clock_Font, sbW, (153 + X + Four.X), (125 + Y + Four.Y));
            Graphic.DrawString("5", Clock_Font, sbW, (130 + X + Five.X), (150 + Y + Five.Y));
            Graphic.DrawString("6", Clock_Font, sbW, (93 + X + Six.X), (160 + Y + Six.Y));
            Graphic.DrawString("7", Clock_Font, sbW, (55 + X + Seven.X), (150 + Y + Seven.Y));
            Graphic.DrawString("8", Clock_Font, sbW, (32 + X + Eight.X), (125 + Y + Eight.Y));
            Graphic.DrawString("9", Clock_Font, sbW, (23 + X + Nine.X), (90 + Y + Nine.Y));
            Graphic.DrawString("10", Clock_Font, sbW, (27 + X + Ten.X), (55 + Y + Ten.Y));
            Graphic.DrawString("11", Clock_Font, sbW, (55 + X + Eleven.X), (30 + Y + Eleven.Y));
            Graphic.DrawString("12", Clock_Font, sbW, (89 + X + Twelve.X), (20 + Y + Twelve.Y));
        }
        else if (frmOptions.rdb2nd.Checked)
        {
            Font Clock_Font_Other = new Font("Bodoni MT Poster Compressed", 11.0F, FontStyle.Bold);
            Graphic.DrawString("I", Clock_Font_Other, sbW, (133 + X + One.X), (30 + Y + One.Y));
            Graphic.DrawString("II", Clock_Font_Other, sbW, (156 + X + Two.X), (55 + Y + Two.Y));
            Graphic.DrawString("III", Clock_Font_Other, sbW, (165 + X + Three.X), (90 + Y + Three.Y));
            Graphic.DrawString("IV", Clock_Font_Other, sbW, (156 + X + Four.X), (125 + Y + Four.Y));
            Graphic.DrawString("V", Clock_Font_Other, sbW, (133 + X + Five.X), (150 + Y + Five.Y));
            Graphic.DrawString("VI", Clock_Font_Other, sbW, (96 + X + Six.X), (160 + Y + Six.Y));
            Graphic.DrawString("VII", Clock_Font_Other, sbW, (58 + X + Seven.X), (150 + Y + Seven.Y));
            Graphic.DrawString("VIII", Clock_Font_Other, sbW, (30 + X + Eight.X), (125 + Y + Eight.Y));
            Graphic.DrawString("IX", Clock_Font_Other, sbW, (26 + X + Nine.X), (90 + Y + Nine.Y));
            Graphic.DrawString("X", Clock_Font_Other, sbW, (30 + X + Ten.X), (55 + Y + Ten.Y));
            Graphic.DrawString("XI", Clock_Font_Other, sbW, (58 + X + Eleven.X), (30 + Y + Eleven.Y));
            Graphic.DrawString("XII", Clock_Font_Other, sbW, (92 + X + Twelve.X), (20 + Y + Twelve.Y));
        }
        else
        {
            Graphic.DrawString("_", Clock_Font, sbW, (162 + X + Three.X), (85 + Y + Three.Y));
            Graphic.DrawString("|", Clock_Font, sbW, (95 + X + Six.X), (160 + Y + Six.Y));
            Graphic.DrawString("_", Clock_Font, sbW, (23 + X + Nine.X), (85 + Y + Nine.Y));
            Graphic.DrawString("|", Clock_Font, sbW, (95 + X + Twelve.X), (20 + Y + Twelve.Y));
        }

        if (DrawHands == true)
        {
            // This code basically sets the center of the drawing, so it acts similar to actual geographic.

            Graphic.TranslateTransform(100, 100, Drawing2D.MatrixOrder.Append);
            // ---------------------------------------------------------------------------

            // Create The Angle Of Each Hand (note that 0 is looking straight up)

            // Basically, 2 * PI is a full turn, we want any value that is 1 to face upwards.

            // gets the ratio of the hours hand rotation (this also adds the little fraction of additional movement due to the minutes hand)
            double hAngle = 2.0 * Math.PI * (DateTime.Now.Hour + (DateTime.Now.Minute / 60.0)) / 12.0; // m_Hours
            // gets the ratio of the minutes hand rotation (this also adds the little fraction of additional movement due to the seconds hand)
            double mAngle = 2.0 * Math.PI * (DateTime.Now.Minute + DateTime.Now.Second / 60.0) / 60.0; // minute
            // gets the ratio of the seconds hand rotation
            double sAngle = 2.0 * Math.PI * (DateTime.Now.Second) / 60.0;                              // seconds

            // ---------------------------------------------------------------------------


            // Draw Hours Hand


            // The point where the hours hand should end
            Point hourEnd = new Point(System.Convert.ToInt32(50 * Math.Sin(hAngle)), System.Convert.ToInt32(-50 * Math.Cos(hAngle)));
            // The two points away 5pts from the start point, they are perpendicular on the hours hand.
            // Since they are perpendicular, the cos and the sin are switched.
            Point hourStart1 = new Point(System.Convert.ToInt32(5 * Math.Cos(hAngle)), System.Convert.ToInt32(5 * Math.Sin(hAngle)));
            Point hourStart2 = new Point(System.Convert.ToInt32(-5 * Math.Cos(hAngle)), System.Convert.ToInt32(-5 * Math.Sin(hAngle)));

            Point[] HourArrow = new[] { hourEnd, hourStart2, hourStart1, hourEnd };
            Drawing2D.GraphicsPath PathHours = new Drawing2D.GraphicsPath();
            PathHours.AddPolygon(HourArrow);

            Drawing2D.LinearGradientBrush hourBrush = new Drawing2D.LinearGradientBrush(PathHours.GetBounds(), Used_Color.Hour_Color1, Used_Color.Hour_Color2, hAngle, false);
            hourBrush.Blend = Clk_Gradient;

            Graphic.FillPath(hourBrush, PathHours);

            // fills a circle around the center of the clock
            Graphic.FillEllipse(hourBrush, -5, -5, 10, 10);
            // ---------------------------------------------------------------------------

            // Draw Minute Hand
            // The point where the minutes hand should end
            Point minEnd = new Point(System.Convert.ToInt32(65 * Math.Sin(mAngle)), System.Convert.ToInt32(-65 * Math.Cos(mAngle)));
            // The two points away 5pts from the start point, they are perpendicular on the minutes hand.
            Point minStart1 = new Point(System.Convert.ToInt32(5 * Math.Cos(mAngle)), System.Convert.ToInt32(5 * Math.Sin(mAngle)));
            Point minStart2 = new Point(System.Convert.ToInt32(-5 * Math.Cos(mAngle)), System.Convert.ToInt32(-5 * Math.Sin(mAngle)));

            Point[] MinArrow = new[] { minEnd, minStart1, minStart2, minEnd };
            Drawing2D.GraphicsPath PathMins = new Drawing2D.GraphicsPath();
            PathMins.AddPolygon(MinArrow);

            Drawing2D.LinearGradientBrush minBrush = new Drawing2D.LinearGradientBrush(PathMins.GetBounds(), Used_Color.Minute_Color1, Used_Color.Minute_Color2, mAngle, false);
            minBrush.Blend = Clk_Gradient;

            Graphic.FillPath(minBrush, PathMins);

            // fills a circle around the center of the clock
            Graphic.FillEllipse(minBrush, -5, -5, 10, 10);
            // ---------------------------------------------------------------------------


            if (!frmOptions.chkHide.Checked)
            {
                // Draw Second Hand
                Pen secondPen = new Pen(Used_Color.Second_Color, 1.5);

                Point SecEnd = new Point(System.Convert.ToInt32(70 * Math.Sin(sAngle)), System.Convert.ToInt32(-70 * Math.Cos(sAngle)));



                if (frmOptions.CheckBox1.Checked)
                {
                    Point SecRectEnd   = new Point(new Point(System.Convert.ToInt32(-13 * Math.Sin(sAngle)), System.Convert.ToInt32(13 * Math.Cos(sAngle))));
                    Point SecRectStart = new Point(new Point(System.Convert.ToInt32(-33 * Math.Sin(sAngle)), System.Convert.ToInt32(33 * Math.Cos(sAngle))));

                    Graphic.DrawLine(secondPen, SecRectEnd, SecEnd);
                    secondPen.Width = 5;
                    Graphic.DrawLine(secondPen, SecRectStart, SecRectEnd);

                    Graphic.FillEllipse(secondPen.Brush, -4, -4, 8, 8);
                }
                else
                {
                    Graphic.DrawLine(secondPen, new Point(0, 0), SecEnd);
                    Graphic.FillEllipse(minBrush, -5, -5, 10, 10);
                }
            }
        }
    }