Esempio n. 1
0
        /// <summary>
        /// Adobes the paint hook.
        /// </summary>
        void Adobe_PaintHook()
        {
            G.Clear(BackColor);

            //Top bar
            G.FillRectangle(new SolidBrush(Adobe_topBar) /*ConversionFunctions.ConvertToBrush(51, 51, 51)*/, 0, 0, Width, 37);
            G.DrawLine(new Pen(Adobe_Line1) /*ConversionFunctions.ConvertToPen(31, 31, 31)*/, 0, 37, Width, 37);
            G.DrawLine(new Pen(Adobe_Line2) /*ConversionFunctions.ConvertToPen(60, 60, 60)*/, 0, 38, Width, 38);

            //Middle
            G.FillRectangle(new SolidBrush(BackColor) /*ConversionFunctions.ConvertToBrush(68, 68, 68)*/, 1, 39, Width - 2, Height - 41);

            //Bottom bar
            G.FillRectangle(new SolidBrush(Adobe_bottomBar) /*ConversionFunctions.ConvertToBrush(51, 51, 51)*/, 1, Height - 37, Width, 37);
            G.DrawLine(new Pen(Adobe_Line1) /*ConversionFunctions.ConvertToPen(31, 31, 31)*/, 0, Height - 37, Width, Height - 37);
            G.DrawLine(new Pen(Adobe_Line2) /*ConversionFunctions.ConvertToPen(60, 60, 60)*/, 0, Height - 38, Width, Height - 38);

            //Title

            switch (textAlign)
            {
            case Alignment.Left:
                //Left
                DrawText(Brushes.Black, Text, HorizontalAlignment.Left, 10, 20);
                DrawText(ConversionFunctions.ConvertToBrush(ForeColor), Text, HorizontalAlignment.Left, 8, 18);
                break;

            case Alignment.Center:
                //Center
                DrawText(Brushes.Black, Text, HorizontalAlignment.Center, 2, 20);
                DrawText(ConversionFunctions.ConvertToBrush(ForeColor), Text, HorizontalAlignment.Center, 0, 18);
                break;

            case Alignment.Right:
                //Right
                DrawText(Brushes.Black, Text, HorizontalAlignment.Right, 10, 20);
                DrawText(ConversionFunctions.ConvertToBrush(ForeColor), Text, HorizontalAlignment.Right, 8, 18);
                break;
            }

            //Border
            DrawBorders(new Pen(Adobe_border1));
            DrawBorders(new Pen(Adobe_border2), 1);

            //Rounding
            switch (Parent.FindForm().FormBorderStyle)
            {
            case FormBorderStyle.None:
                DrawCorners(Color.Fuchsia);
                break;

            default:
                DrawCorners(Color.Black);
                break;
            }
        }
Esempio n. 2
0
        protected override void PaintHook()
        {
            Pen P1 = default(Pen);
            Pen P2 = default(Pen);

            P1 = new Pen(new SolidBrush(Color.FromArgb(31, 31, 31)));
            P2 = new Pen(new SolidBrush(Color.FromArgb(131, 131, 131)));

            G.Clear(BackColor);

            DrawBorders(P1, new Rectangle(0, 10, Width, Height - 10));
            DrawBorders(P2, new Rectangle(0, 10, Width, Height - 10), 1);
            DrawBorders(P1, new Rectangle(10, 0, Convert.ToInt32(G.MeasureString(Text, Font).Width + 10), 20));
            DrawBorders(P2, new Rectangle(10, 0, Convert.ToInt32(G.MeasureString(Text, Font).Width + 10), 20), 1);

            G.FillRectangle(new SolidBrush(BackColor), new Rectangle(12, 2, Convert.ToInt32(G.MeasureString(Text, Font).Width + 6), 20));
            G.DrawString(Text, Font, new SolidBrush(ForeColor), 14, 4);
            G.DrawString(Text, Font, ConversionFunctions.ConvertToBrush(Color.FromArgb(50, Color.Black)), 16, 6);
        }
Esempio n. 3
0
        protected override void PaintHook()
        {
            G.Clear(Color.FromArgb(102, 102, 102));

            Rectangle R1 = new Rectangle(0, 0, Width, Height);                                          //
                                                                                                        //
            PointF ipt = ImageLocation(GetStringFormat(ImageAlign), Size, ImageSize);                   //
                                                                                                        //


            int   gC    = 15;
            Color _text = Color.White;
            Color C1    = default(Color);
            Color C2    = default(Color);
            Color C3    = default(Color);
            Color C4    = default(Color);

            switch (Alternate)
            {
            case true:
                C1 = Color.FromArgb(255, 209, 51);
                C2 = Color.FromArgb(255, 165, 13);
                C3 = Color.FromArgb(255, 195, 13);
                C4 = Color.FromArgb(255, 163, 0);
                break;

            case false:
                C1 = Color.FromArgb(105, 105, 105);
                C2 = Color.FromArgb(56, 56, 56);
                C3 = Color.FromArgb(73, 73, 73);
                C4 = Color.FromArgb(48, 48, 48);
                break;
            }

            DrawGradient(C1, C2, 0, 0, Width, Height, 90);
            DrawGradient(C3, C4, 1, 1, Width - 2, Height - 2, 90);

            switch (State)
            {
            case MouseState.None:
                break;

            //NULL
            case MouseState.Over:
                switch (Alternate)
                {
                case true:
                    _text = Color.Black;
                    break;
                }
                gC = 5;
                break;

            case MouseState.Down:
                switch (Alternate)
                {
                case true:
                    _text = Color.White;
                    break;
                }
                gC = 10;
                break;
            }

            for (int i = 1; i <= 5; i++)
            {
                G.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(Convert.ToInt32(255 / (i * gC)), Color.White))), new Rectangle(i, i, Width - 2 - (i * 2), Height - 2 - (i * 2)));
            }

            DrawBorders(Pens.Black);
            DrawText(ConversionFunctions.ConvertToBrush(Color.FromArgb(180, Color.Black)), HorizontalAlignment.Center, 0, 2);
            DrawText(ConversionFunctions.ConvertToBrush(_text), HorizontalAlignment.Center, -1, 1);

            if ((Image == null))                                                                    //
            {                                                                                       //
                //G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat           //
                //{                                                                               //
                //    Alignment = _TextAlignment,                                                 //
                //    LineAlignment = StringAlignment.Center                                      //
                //});                                                                             //
            }                                                                                      //
            else                                                                                   //
            {                                                                                      //
                G.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width, ImageSize.Height);              //
                //G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat          //
                //{                                                                               //
                //    Alignment = _TextAlignment,                                                 //
                //    LineAlignment = StringAlignment.Center                                      //
                //});                                                                             //
            }
        }