Beispiel #1
0
        private void RenderSkinFormSysBottomInternal(
            Graphics g,
            Rectangle rect,
            ControlBoxState state,
            bool active,
            SkinForm form)
        {
            Bitmap          image            = null;
            SkinPictureForm imageForm        = (SkinPictureForm)form;
            Color           controlBoxActive = this.ColorTable.ControlBoxActive;

            if (state == ControlBoxState.Pressed)
            {
                image            = (Bitmap)imageForm.SysBottomDown;
                controlBoxActive = this.ColorTable.ControlBoxPressed;
            }
            else if (state == ControlBoxState.Hover)
            {
                image            = (Bitmap)imageForm.SysBottomMouse;
                controlBoxActive = this.ColorTable.ControlBoxHover;
            }
            else
            {
                image            = (Bitmap)imageForm.SysBottomNorml;
                controlBoxActive = active ? this.ColorTable.ControlBoxActive : this.ColorTable.ControlBoxDeactive;
            }
            if (image != null)
            {
                g.DrawImage(image, rect);
            }
            else
            {
                RoundStyle bottomLeft = RoundStyle.BottomLeft;
                using (new AntiAliasGraphics(g))
                {
                    RenderHelper.RenderBackgroundInternal(g, rect, controlBoxActive, controlBoxActive, this.ColorTable.ControlBoxInnerBorder, bottomLeft, 6, 0.38f, true, false, LinearGradientMode.Vertical);
                    using (Pen pen = new Pen(this.ColorTable.Border))
                    {
                        g.DrawLine(pen, rect.X, rect.Y, rect.Right, rect.Y);
                    }
                }
            }
        }
Beispiel #2
0
        private void RenderSkinFormCloseBoxInternal(
            Graphics g,
            Rectangle rect,
            ControlBoxState state,
            bool active,
            bool minimizeBox,
            bool maximizeBox,
            SkinForm form)
        {
            Bitmap          image     = null;
            Color           baseColor = ColorTable.ControlBoxActive;
            SkinPictureForm imageForm = (SkinPictureForm)form;

            if (state == ControlBoxState.Pressed)
            {
                image     = (Bitmap)imageForm.CloseDownBack;
                baseColor = ColorTable.ControlCloseBoxPressed;
            }
            else if (state == ControlBoxState.Hover)
            {
                image     = (Bitmap)imageForm.CloseMouseBack;
                baseColor = ColorTable.ControlCloseBoxHover;
            }
            else
            {
                image     = (Bitmap)imageForm.CloseNormlBack;
                baseColor = active ? ColorTable.ControlBoxActive : ColorTable.ControlBoxDeactive;
            }

            if (image != null)
            {
                g.DrawImage(image, rect);
            }
            else
            {
                RoundStyle roundStyle = minimizeBox || maximizeBox ?
                                        RoundStyle.BottomRight : RoundStyle.Bottom;

                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.CreateCloseFlagPath(rect))
                    {
                        g.FillPath(Brushes.White, path);
                        using (Pen pen = new Pen(baseColor))
                        {
                            g.DrawPath(pen, path);
                        }
                    }
                }
            }
        }