private void RenderSkinFormMaximizeBoxInternal(
            Graphics g,
            Rectangle rect,
            ControlBoxState state,
            bool active,
            bool minimizeBox,
            bool maximize)
        {
            Color baseColor = ColorTable.ControlBoxActive;

            if (state == ControlBoxState.Pressed)
            {
                baseColor = ColorTable.ControlBoxPressed;
            }
            else if (state == ControlBoxState.Hover)
            {
                baseColor = ColorTable.ControlBoxHover;
            }
            else
            {
                baseColor = active ?
                            ColorTable.ControlBoxActive :
                            ColorTable.ControlBoxDeactive;
            }

            RoundStyle roundStyle = minimizeBox ?
                                    RoundStyle.None : RoundStyle.BottomLeft;

            using (AntiAliasGraphics antiGraphics = new AntiAliasGraphics(g))
            {
                RenderHelper.RenderBackgroundInternal(
                    g,
                    rect,
                    baseColor,
                    baseColor,
                    ColorTable.ControlBoxInnerBorder,
                    roundStyle,
                    6,
                    .38F,
                    true,
                    false,
                    LinearGradientMode.Vertical);

                using (Pen pen = new Pen(ColorTable.Border))
                {
                    g.DrawLine(pen, rect.X, rect.Y, rect.Right, rect.Y);
                }

                using (GraphicsPath path = DrawUtil.CreateMaximizeFlafPath(rect, maximize))
                {
                    g.FillPath(Brushes.White, path);
                    using (Pen pen = new Pen(baseColor))
                    {
                        g.DrawPath(pen, path);
                    }
                }
            }
        }
Esempio n. 2
0
        private void RenderSkinFormMaximizeBoxInternal(
            Graphics g,
            Rectangle rect,
            ControlBoxState state,
            bool active,
            bool minimizeBox,
            bool maximize,
            SkinForm form)
        {
            Bitmap          image     = null;
            SkinPictureForm imageForm = (SkinPictureForm)form;
            Color           baseColor = ColorTable.ControlBoxActive;

            if (state == ControlBoxState.Pressed)
            {
                image     = maximize ? (Bitmap)imageForm.MaxDownBack : (Bitmap)imageForm.RestoreDownBack;
                baseColor = ColorTable.ControlBoxPressed;
            }
            else if (state == ControlBoxState.Hover)
            {
                image     = maximize ? (Bitmap)imageForm.MaxMouseBack : (Bitmap)imageForm.RestoreMouseBack;
                baseColor = ColorTable.ControlBoxHover;
            }
            else
            {
                image     = maximize ? (Bitmap)imageForm.MaxNormlBack : (Bitmap)imageForm.RestoreNormlBack;
                baseColor = active ? ColorTable.ControlBoxActive : ColorTable.ControlBoxDeactive;
            }

            if (image != null)
            {
                g.DrawImage(image, rect);
            }
            else
            {
                RoundStyle roundStyle = minimizeBox ?
                                        RoundStyle.None : RoundStyle.BottomLeft;

                using (AntiAliasGraphics antiGraphics = new AntiAliasGraphics(g))
                {
                    RenderHelper.RenderBackgroundInternal(
                        g,
                        rect,
                        baseColor,
                        baseColor,
                        ColorTable.ControlBoxInnerBorder,
                        roundStyle,
                        6,
                        .38F,
                        true,
                        false,
                        LinearGradientMode.Vertical);

                    using (Pen pen = new Pen(ColorTable.Border))
                    {
                        g.DrawLine(pen, rect.X, rect.Y, rect.Right, rect.Y);
                    }

                    using (GraphicsPath path = DrawUtil.CreateMaximizeFlafPath(rect, maximize))
                    {
                        g.FillPath(Brushes.White, path);
                        using (Pen pen = new Pen(baseColor))
                        {
                            g.DrawPath(pen, path);
                        }
                    }
                }
            }
        }