Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnRenderSkinFormBackground(SkinFormBackgroundRenderEventArgs e)
        {
            Graphics g = e.Graphics;

            Rectangle rect = e.ClipRectangle;

            SkinForm form = e.SkinForm;

            using (FormAntiAliasGraphics antiGraphics = new FormAntiAliasGraphics(g))
            {
                int bc = int.Parse(this.ColorTable.BaseColor.B.ToString());

                int gc = int.Parse(this.ColorTable.BaseColor.G.ToString());

                int rc = int.Parse(this.ColorTable.BaseColor.R.ToString());

                using (LinearGradientBrush brush = new LinearGradientBrush(rect, this.ColorTable.BaseColor, this.GetUndertoneColor(rc, gc, bc), 90f, true))
                {
                    using (GraphicsPath path = FormGraphicsPathHelper.CreatePath(rect, form.Radius, form.RoundStyle, false))
                    {
                        g.FillPath(brush, path);
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="G"></param>
        /// <param name="Rect"></param>
        /// <param name="State"></param>
        /// <param name="Active"></param>
        /// <param name="MinimizeBox"></param>
        /// <param name="MaximizeBox"></param>
        private void RenderSkinFormCloseBoxInternal(
            Graphics G,
            Rectangle Rect,
            FormControlBoxState State,
            bool Active,
            bool MinimizeBox,
            bool MaximizeBox)
        {
            Color baseColor = ColorTable.ControlBoxActiveColor;

            if (State == FormControlBoxState.Pressed)
            {
                baseColor = ColorTable.ControlCloseBoxPressedColor;
            }
            else if (State == FormControlBoxState.Hover)
            {
                baseColor = ColorTable.ControlCloseBoxHoverColor;
            }
            else
            {
                baseColor = Active ?
                            ColorTable.ControlBoxActiveColor :
                            ColorTable.CaptionDeleteActiveColor;
            }

            FormRoundStyle roundStyle = MinimizeBox || MaximizeBox ?
                                        FormRoundStyle.BottomRight : FormRoundStyle.Bottom;

            using (FormAntiAliasGraphics antiGraphics = new FormAntiAliasGraphics(G))
            {
                FormRenderHelper.RenderBackgroundInternal(
                    G,
                    Rect,
                    baseColor,
                    baseColor,
                    ColorTable.ControlBoxInnerBorderColor,
                    roundStyle,
                    6,
                    .38F,
                    false,
                    false,
                    LinearGradientMode.Vertical,
                    System.Windows.Forms.Orientation.Horizontal);

                using (Pen pen = new Pen(ColorTable.BorderColor))
                {
                    G.DrawLine(pen, Rect.X, Rect.Y, Rect.Right, Rect.Y);
                }

                using (GraphicsPath path = CreateCloseFlagPath(Rect))
                {
                    G.FillPath(Brushes.White, path);
                    using (Pen pen = new Pen(baseColor))
                    {
                        G.DrawPath(pen, path);
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnRenderSkinFormBorder(SkinFormBorderRenderEventArgs e)
        {
            Graphics g = e.Graphics;

            using (FormAntiAliasGraphics antiGraphics = new FormAntiAliasGraphics(g))
            {
                DrawBorder(
                    g,
                    e.ClipRectangle,
                    e.SkinForm.RoundStyle,
                    e.SkinForm.Radius);
            }
        }