Esempio n. 1
0
        void SkyBase_PaintHook(System.Windows.Forms.PaintEventArgs e)
        {
            SkyBase_T1 = new Rectangle(1, 1, Width - 3, 18);

            Bitmap SkyBase_B = new Bitmap(Width, Height);

            G = Graphics.FromImage(SkyBase_B);

            //Drawing
            G.Clear(SkyBase_C1);
            LinearGradientBrush SkyBase_G1 = new LinearGradientBrush(new Point(SkyBase_T1.X, SkyBase_T1.Y), new Point(SkyBase_T1.X, SkyBase_T1.Y + SkyBase_T1.Height), SkyBase_C3, SkyBase_C4);

            G.FillRectangle(SkyBase_G1, SkyBase_T1);
            G.DrawRectangle(ConversionFunctions.ToPen(SkyBase_C2), SkyBase_T1);
            G.DrawRectangle(ConversionFunctions.ToPen(SkyBase_C2), new Rectangle(SkyBase_T1.X, SkyBase_T1.Y + SkyBase_T1.Height + 2, SkyBase_T1.Width, Height - SkyBase_T1.Y - SkyBase_T1.Height - 4));

            SkyBase_G1.Dispose();

            G.DrawString(Text, Font, ConversionFunctions.ToBrush(113, 170, 186), new Rectangle(new Point(SkyBase_T1.X + 4, SkyBase_T1.Y), new Size(SkyBase_T1.Width - 40, SkyBase_T1.Height)), new StringFormat {
                LineAlignment = StringAlignment.Center
            });


            //Finish Up
            e.Graphics.DrawImage((Bitmap)SkyBase_B.Clone(), 0, 0);
            //G.Dispose();
            SkyBase_B.Dispose();
        }
Esempio n. 2
0
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            Graphics G = e.Graphics;

            G.Clear(Color.FromArgb(246, 246, 246));

            G.DrawRectangle(ConversionFunctions.ToPen(150, 150, 150), new Rectangle(0, Convert.ToInt32(G.MeasureString(Text, Font).Height / 2), Width - 1, Height - 1 - Convert.ToInt32(G.MeasureString(Text, Font).Height / 2)));

            int TOff = 0;

            switch (TA)
            {
            case TAlign.Left:
                TOff = 6;
                break;

            case TAlign.Right:
                TOff = Width - 6 - (int)G.MeasureString(Text, Font).Width;
                break;

            case TAlign.Center:
                TOff = Convert.ToInt32((Width / 2) - (G.MeasureString(Text, Font).Width / 2));
                break;
            }

            G.FillRectangle(ConversionFunctions.ToBrush(246, 246, 246), new Rectangle(new Point(TOff, 0), G.MeasureString(Text, Font).ToSize()));

            G.DrawString(Text, Font, Brushes.Black, TOff, 0);
        }
    protected override void OnPaint(PaintEventArgs e)
    {
        Bitmap              image    = new Bitmap(base.Width, base.Height);
        Graphics            graphics = Graphics.FromImage(image);
        LinearGradientBrush brush    = new LinearGradientBrush(new Point(0, 0), new Point(0, base.Height), this.C3, this.C4);

        graphics.FillRectangle(brush, base.ClientRectangle);
        brush.Dispose();
        graphics.SmoothingMode = SmoothingMode.HighQuality;
        switch (this.State)
        {
        case MouseState.None:
            graphics.DrawEllipse(new Pen(this.C1, 2f), new Rectangle(2, 2, base.Width - 5, base.Height - 5));
            break;

        case MouseState.Over:
            graphics.DrawEllipse(new Pen(this.C2, 2f), new Rectangle(2, 2, base.Width - 5, base.Height - 5));
            break;

        case MouseState.Down:
            graphics.DrawEllipse(new Pen(this.CD, 2f), new Rectangle(2, 2, base.Width - 5, base.Height - 5));
            break;
        }
        graphics.FillEllipse(ConversionFunctions.ToBrush(this.C2), new Rectangle(5, 5, base.Width - 11, base.Height - 11));
        e.Graphics.DrawImage(image, 0, 0);
        graphics.Dispose();
        image.Dispose();
    }
        protected override void OnPaint(PaintEventArgs e)
        {
            if (!(DropDownStyle == ComboBoxStyle.DropDownList))
            {
                DropDownStyle = ComboBoxStyle.DropDownList;
            }
            base.OnPaint(e);
            Graphics            G = e.Graphics;
            LinearGradientBrush T = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(0, Color.Black), Color.FromArgb(22, Color.Black), 90);
            SolidBrush          DrawCornersBrush = new SolidBrush(Color.FromArgb(20, 20, 20));

            DrawCornersBrush = (SolidBrush)ConversionFunctions.ToBrush(20, 20, 20);
            try
            {
                var _with1 = G;
                G.SmoothingMode = SmoothingMode.HighQuality;
                _with1.Clear(Color.FromArgb(20, 20, 20));
                _with1.FillRectangle(T, new Rectangle(0, 0, Width, Height));
                _with1.DrawLine(ConversionFunctions.ToPen(20, 20, 20), 0, 0, 0, 0);
                _with1.DrawRectangle(ConversionFunctions.ToPen(70, 70, 70), new Rectangle(1, 1, Width - 3, Height - 3));

                _with1.DrawLine(ConversionFunctions.ToPen(80, Color.White), new Point(Width - 22, 4), new Point(Width - 22, Height - 5));

                GraphicsPath K = new GraphicsPath();
                K.AddEllipse(-Width / 2, -Height, Width * 2, Convert.ToInt32(Height * 1.55));

                PathGradientBrush kK = new PathGradientBrush(K);
                kK.CenterColor    = Color.Transparent;
                kK.SurroundColors = new Color[] { Color.FromArgb(30, Color.DimGray) };
                _with1.FillPath(kK, K);

                try
                {
                    if (_with1.MeasureString(Text, Font).Width > Width - 29)
                    {
                        _with1.DrawString(Items[SelectedIndex].ToString(), Font, ConversionFunctions.ToBrush(71, 71, 71), new RectangleF(3, 3, Width - 35, Height - 7));
                        _with1.DrawString("...", Font, ConversionFunctions.ToBrush(230, 230, 230), new Point(Width - 38, 3));
                    }
                    else
                    {
                        _with1.DrawString(Items[SelectedIndex].ToString(), Font, ConversionFunctions.ToBrush(71, 71, 71), new RectangleF(3, 3, Width - 35, Height - 7));
                    }
                }
                catch
                {
                    _with1.DrawString("...", Font, ConversionFunctions.ToBrush(230, 230, 230), new Point(3, 3));
                }

                DrawTriangle(Color.FromArgb(230, 230, 230), new Point(Width - 15, Height - 10), new Point(Width - 12, Height - 7), new Point(Width - 9, Height - 10), G);
                DrawTriangle(Color.FromArgb(60, 60, 60), new Point(Width - 15, Height - 12), new Point(Width - 12, Height - 8), new Point(Width - 9, Height - 12), G);
                DrawTriangle(Color.FromArgb(230, 230, 230), new Point(Width - 15, 9), new Point(Width - 12, 6), new Point(Width - 9, 9), G);
                DrawTriangle(Color.FromArgb(60, 60, 60), new Point(Width - 15, 11), new Point(Width - 12, 7), new Point(Width - 9, 11), G);

                _with1.DrawPath(ConversionFunctions.ToPen(120, Color.Black), RRM.RoundRect(0, 0, Width - 1, Height - 1, 2));
            }
            catch
            {
            }
        }
    protected override void OnPaint(PaintEventArgs e)
    {
        Bitmap   image    = new Bitmap(base.Width - 5, base.Height - 5);
        Graphics graphics = Graphics.FromImage(image);

        graphics.Clear(base.Parent.BackColor);
        this.C3 = Color.FromArgb(70, 0x45, 0x44);
        this.C4 = Color.FromArgb(0x40, 60, 0x3b);
        switch (base.Enabled)
        {
        case false:
            this.C5 = Color.FromArgb(0x58, 0x58, 0x58);
            break;

        case true:
            switch (this.State)
            {
            case MouseState.None:
                this.C5 = Color.FromArgb(0x97, 0xb5, 190);
                break;

            case MouseState.Down:
                this.C5 = Color.FromArgb(0x79, 0x97, 160);
                this.C3 = Color.FromArgb(0x40, 60, 0x3b);
                this.C4 = Color.FromArgb(70, 0x45, 0x44);
                break;
            }
            break;
        }
        Rectangle           rect  = new Rectangle(0, 0, base.Height - 6, base.Height - 6);
        LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X, rect.Y), new Point(rect.X, rect.Y + rect.Height), this.C3, this.C4);

        graphics.FillRectangle(brush, rect);
        brush.Dispose();
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), rect);
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height - 2));
        Rectangle rectangle2 = new Rectangle(rect.X + (rect.Width / 4), rect.Y + (rect.Height / 4), rect.Width / 2, rect.Height / 2);

        Point[] pointArray = new Point[] { new Point(rectangle2.X, rectangle2.Y + (rectangle2.Height / 2)), new Point(rectangle2.X + (rectangle2.Width / 2), rectangle2.Y + rectangle2.Height), new Point(rectangle2.X + rectangle2.Width, rectangle2.Y) };
        if (this.Checked)
        {
            graphics.SmoothingMode = SmoothingMode.HighQuality;
            Pen pen = new Pen(ConversionFunctions.ToBrush(this.C5), 2f);
            for (int i = 0; i <= (pointArray.Length - 2); i++)
            {
                graphics.DrawLine(pen, pointArray[i], pointArray[i + 1]);
            }
        }
        StringFormat format = new StringFormat {
            LineAlignment = StringAlignment.Center,
            Alignment     = StringAlignment.Near
        };

        graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(this.C5), new Rectangle((rect.X + rect.Width) + 5, 0, ((base.Width - rect.X) - rect.Width) - 5, base.Height), format);
        e.Graphics.DrawImage(image, 0, 0);
        graphics.Dispose();
        image.Dispose();
    }
    protected override void OnPaint(PaintEventArgs e)
    {
        Bitmap   image    = new Bitmap(base.Width, base.Height);
        Graphics graphics = Graphics.FromImage(image);

        graphics.Clear(base.Parent.BackColor);
        switch (base.Enabled)
        {
        case false:
            this.C2 = Color.FromArgb(70, 70, 70);
            this.C3 = Color.FromArgb(0x36, 0x36, 0x33);
            this.C4 = Color.FromArgb(0x59, 0x58, 0x58);
            break;

        case true:
            switch (this.State)
            {
            case MouseState.None:
                this.C2 = Color.FromArgb(70, 70, 70);
                this.C3 = Color.FromArgb(0x36, 0x36, 0x33);
                this.C4 = Color.FromArgb(0x98, 0xb6, 0xc0);
                break;

            case MouseState.Down:
                this.C2 = Color.FromArgb(0x36, 0x36, 0x33);
                this.C3 = Color.FromArgb(70, 70, 70);
                this.C4 = Color.FromArgb(0x70, 0x8e, 0x98);
                break;
            }
            break;
        }
        Rectangle           rect  = new Rectangle(0, 0, base.Height - 1, base.Height - 1);
        LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X + (rect.Width / 2), rect.Y), new Point(rect.X + (rect.Width / 2), rect.Y + rect.Height), this.C2, this.C3);

        graphics.SmoothingMode = SmoothingMode.HighQuality;
        graphics.FillEllipse(brush, rect);
        graphics.DrawEllipse(new Pen(ConversionFunctions.ToBrush(this.C1)), rect);
        if (this.Checked)
        {
            graphics.FillEllipse(ConversionFunctions.ToBrush(this.C4), new Rectangle(rect.X + (rect.Width / 4), rect.Y + (rect.Height / 4), rect.Width / 2, rect.Height / 2));
        }
        StringFormat format = new StringFormat {
            LineAlignment = StringAlignment.Center,
            Alignment     = StringAlignment.Near
        };

        graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(this.C4), new Rectangle((rect.X + rect.Width) + 5, 0, ((base.Width - rect.X) - rect.Width) - 5, base.Height), format);
        e.Graphics.DrawImage(image, 0, 0);
        graphics.Dispose();
        image.Dispose();
    }
 public void ReplaceItem(System.Object sender, System.Windows.Forms.DrawItemEventArgs e)
 {
     e.DrawBackground();
     try
     {
         if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
         {
             e.Graphics.FillRectangle(ConversionFunctions.ToBrush(200, 200, 200), e.Bounds);
         }
         e.Graphics.DrawString(base.GetItemText(base.Items[e.Index]), e.Font, ConversionFunctions.ToBrush(71, 71, 71), e.Bounds);
     }
     catch
     {
     }
 }
    protected override void OnPaint(PaintEventArgs e)
    {
        Bitmap              image    = new Bitmap(base.Width, base.Height);
        Graphics            graphics = Graphics.FromImage(image);
        LinearGradientBrush brush    = new LinearGradientBrush(new Point(0, 0), new Point(0, base.Height), this.C3, this.C4);

        graphics.FillRectangle(brush, 0, 0, base.Width, base.Height);
        brush.Dispose();
        if (base.Enabled)
        {
            switch (this.State)
            {
            case MouseState.Over:
                graphics.FillRectangle(new SolidBrush(Color.FromArgb(20, Color.White)), new Rectangle(0, 0, base.Width, base.Height));
                break;

            case MouseState.Down:
                graphics.FillRectangle(new SolidBrush(Color.FromArgb(10, Color.Black)), new Rectangle(0, 0, base.Width, base.Height));
                break;
            }
        }
        StringFormat format = new StringFormat {
            LineAlignment = StringAlignment.Center,
            Alignment     = StringAlignment.Center
        };

        switch (base.Enabled)
        {
        case false:
            graphics.DrawString(this.Text, this.Font, Brushes.Gray, new Rectangle(0, 0, base.Width - 1, base.Height - 1), format);
            break;

        case true:
            graphics.DrawString(this.Text, this.Font, ConversionFunctions.ToBrush(0x71, 170, 0xba), new Rectangle(0, 0, base.Width - 1, base.Height - 1), format);
            break;
        }
        format.Dispose();
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C1), 0, 0, base.Width - 1, base.Height - 1);
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 1, 1, base.Width - 3, base.Height - 3);
        e.Graphics.DrawImage(image, 0, 0);
        graphics.Dispose();
        image.Dispose();
    }
    protected override void OnPaint(PaintEventArgs e)
    {
        this.T1 = new Rectangle(1, 1, base.Width - 3, 0x12);
        Bitmap   image    = new Bitmap(base.Width, base.Height);
        Graphics graphics = Graphics.FromImage(image);

        graphics.Clear(this.C1);
        LinearGradientBrush brush = new LinearGradientBrush(new Point(this.T1.X, this.T1.Y), new Point(this.T1.X, this.T1.Y + this.T1.Height), this.C3, this.C4);

        graphics.FillRectangle(brush, this.T1);
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), this.T1);
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(this.T1.X, (this.T1.Y + this.T1.Height) + 2, this.T1.Width, ((base.Height - this.T1.Y) - this.T1.Height) - 4));
        brush.Dispose();
        StringFormat format = new StringFormat {
            LineAlignment = StringAlignment.Center
        };

        graphics.DrawString(base.Text, this.Font, ConversionFunctions.ToBrush(0x71, 170, 0xba), new Rectangle(new Point(this.T1.X + 4, this.T1.Y), new Size(this.T1.Width - 40, this.T1.Height)), format);
        e.Graphics.DrawImage(image, 0, 0);
        graphics.Dispose();
        image.Dispose();
    }
    protected override void OnPaint(PaintEventArgs e)
    {
        Bitmap   image    = new Bitmap(base.Width, base.Height);
        Graphics graphics = Graphics.FromImage(image);

        try
        {
            base.SelectedTab.BackColor = this.C1;
        }
        catch
        {
        }
        graphics.Clear(base.Parent.BackColor);
        for (int i = 0; i <= (base.TabCount - 1); i++)
        {
            if (i == base.SelectedIndex)
            {
                continue;
            }
            Rectangle           rect  = new Rectangle(base.GetTabRect(i).X, base.GetTabRect(i).Y + 3, base.GetTabRect(i).Width + 2, base.GetTabRect(i).Height);
            LinearGradientBrush brush = new LinearGradientBrush(new Point(rect.X, rect.Y), new Point(rect.X, rect.Y + rect.Height), Color.FromArgb(60, 0x3b, 0x3a), Color.FromArgb(0x45, 0x45, 70));
            graphics.FillRectangle(brush, rect);
            brush.Dispose();
            graphics.DrawRectangle(ConversionFunctions.ToPen(this.C3), rect);
            graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 2, rect.Height));
            string s = string.Empty;
            switch (i)
            {
            case 0:
                s = "Main";
                break;

            case 1:
                s = "Extra";
                break;

            case 2:
                s = "Scan";
                break;

            case 3:
                s = "Info";
                break;
            }
            StringFormat format = new StringFormat {
                LineAlignment = StringAlignment.Center,
                Alignment     = StringAlignment.Center
            };
            graphics.DrawString(s, this.Font, ConversionFunctions.ToBrush(130, 0xb0, 190), rect, format);
        }
        graphics.FillRectangle(ConversionFunctions.ToBrush(this.C1), 0, base.ItemSize.Height, base.Width, base.Height);
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C2), 0, base.ItemSize.Height, base.Width - 1, (base.Height - base.ItemSize.Height) - 1);
        graphics.DrawRectangle(ConversionFunctions.ToPen(this.C3), 1, base.ItemSize.Height + 1, base.Width - 3, (base.Height - base.ItemSize.Height) - 3);
        if (base.SelectedIndex != -1)
        {
            string str2 = string.Empty;
            if (base.SelectedIndex == 0)
            {
                str2 = "Main";
            }
            else if (base.SelectedIndex == 1)
            {
                str2 = "Extra";
            }
            else if (base.SelectedIndex == 2)
            {
                str2 = "Scan";
            }
            else if (base.SelectedIndex == 3)
            {
                str2 = "Info";
            }
            Rectangle layoutRectangle = new Rectangle(base.GetTabRect(base.SelectedIndex).X - 2, base.GetTabRect(base.SelectedIndex).Y, base.GetTabRect(base.SelectedIndex).Width + 3, base.GetTabRect(base.SelectedIndex).Height);
            graphics.FillRectangle(ConversionFunctions.ToBrush(this.C1), new Rectangle(layoutRectangle.X + 2, layoutRectangle.Y + 2, layoutRectangle.Width - 2, layoutRectangle.Height));
            graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X, (layoutRectangle.Y + layoutRectangle.Height) - 2), new Point(layoutRectangle.X, layoutRectangle.Y));
            graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X, layoutRectangle.Y), new Point(layoutRectangle.X + layoutRectangle.Width, layoutRectangle.Y));
            graphics.DrawLine(ConversionFunctions.ToPen(this.C2), new Point(layoutRectangle.X + layoutRectangle.Width, layoutRectangle.Y), new Point(layoutRectangle.X + layoutRectangle.Width, (layoutRectangle.Y + layoutRectangle.Height) - 2));
            graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point(layoutRectangle.X + 1, (layoutRectangle.Y + layoutRectangle.Height) - 1), new Point(layoutRectangle.X + 1, layoutRectangle.Y + 1));
            graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point(layoutRectangle.X + 1, layoutRectangle.Y + 1), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, layoutRectangle.Y + 1));
            graphics.DrawLine(ConversionFunctions.ToPen(this.C3), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, layoutRectangle.Y + 1), new Point((layoutRectangle.X + layoutRectangle.Width) - 1, (layoutRectangle.Y + layoutRectangle.Height) - 1));
            StringFormat format2 = new StringFormat {
                LineAlignment = StringAlignment.Center,
                Alignment     = StringAlignment.Center
            };
            graphics.DrawString(str2, this.Font, ConversionFunctions.ToBrush(130, 0xb0, 190), layoutRectangle, format2);
        }
        e.Graphics.DrawImage(image, 0, 0);
        graphics.Dispose();
        image.Dispose();
    }