Esempio n. 1
0
        protected override void OnPaint(PaintEventArgs pevent)
        {
            base.OnPaint(pevent);
            var g = pevent.Graphics;

            g.TextRenderingHint = TextRenderingHint.AntiAlias;

            StringColor      = ColorTranslator.FromHtml(fontcolor);
            ThumbnailBGColor = ColorTranslator.FromHtml(thumbnailcolor);

            var BG          = DrawHelper.CreateRoundRect(1, 1, Width - 3, Height - 3, 1);
            var ThumbnailBG = DrawHelper.CreateLeftRoundRect(1, 1, 50, 49, 1);

            g.FillPath(new SolidBrush(BgColor), BG);
            g.DrawPath(new Pen(BorderColor), BG);

            g.FillPath(new SolidBrush(ThumbnailBGColor), ThumbnailBG);
            g.DrawPath(new Pen(ThumbnailBGColor), ThumbnailBG);

            if (image != null)
            {
                g.DrawImage(image, 3, 3, 48, 47);
            }
            if (Enabled)
            {
                g.DrawString(Text, SkinManager.ROBOTO_MEDIUM_10, new SolidBrush(StringColor), new PointF(58.6f, 9f));
            }
            else
            {
                g.DrawString("Wait...", SkinManager.ROBOTO_MEDIUM_10, new SolidBrush(StringColor), new PointF(58.6f, 9f));
            }

            g.TextRenderingHint = TextRenderingHint.AntiAlias;
            g.DrawString(information, SkinManager.ROBOTO_MEDIUM_10, new SolidBrush(ColorTranslator.FromHtml("#999999")), new PointF(59.1f, 26f));
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            Graphics G = e.Graphics;

            G.SmoothingMode = SmoothingMode.HighQuality;

            var BG          = DrawHelper.CreateRoundRect(1, 1, Width - 3, Height - 3, 1);
            var ThumbnailBG = DrawHelper.CreateLeftRoundRect(1, 1, 50, 49, 1);

            G.FillPath(new SolidBrush(MaterialSkinManager.GetApplicationBackgroundColor()), BG);
            //Hover
            Color c = MaterialSkinManager.GetFlatButtonHoverBackgroundColor();

            using (Brush b = new SolidBrush(Color.FromArgb((int)(hoverAnimationManager.GetProgress() * c.A), c.RemoveAlpha())))
                G.FillPath(b, BG);
            G.DrawPath(new Pen(MaterialSkinManager.GetDividersColor()), BG);

            G.FillPath(MaterialSkinManager.ColorScheme.PrimaryBrush, ThumbnailBG);
            G.DrawPath(MaterialSkinManager.ColorScheme.PrimaryPen, ThumbnailBG);

            if (image != null)
            {
                G.DrawImage(image, 3, 3, 48, 47);
            }
            if (Enabled)
            {
                G.DrawString(Text, MaterialSkinManager.ROBOTO_MEDIUM_10, Primary ? MaterialSkinManager.ColorScheme.PrimaryBrush : MaterialSkinManager.GetPrimaryTextBrush(), new PointF(58.6f, 9f));
            }
            else
            {
                G.DrawString(Text, MaterialSkinManager.ROBOTO_MEDIUM_10, new SolidBrush(MaterialSkinManager.GetDisabledOrHintColor()), new PointF(58.6f, 9f));
            }

            G.TextRenderingHint = TextRenderingHint.AntiAlias;
            G.DrawString(info, MaterialSkinManager.ROBOTO_REGULAR_9, new SolidBrush(MaterialSkinManager.GetSecondaryTextColor()), new PointF(59.1f, 26f));
            if (!DesignMode && Controls.Count > 0)
            {
                this.DrawChildShadow(G);
            }
        }
Esempio n. 3
0
    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);

        Graphics G = e.Graphics;

        G.SmoothingMode = SmoothingMode.HighQuality;
        G.Clear(Parent.BackColor);

        StringColor      = ColorTranslator.FromHtml(fontcolor);
        ThumbnailBGColor = ColorTranslator.FromHtml(thumbnailcolor);

        var BG          = DrawHelper.CreateRoundRect(1, 1, Width - 3, Height - 3, 1);
        var ThumbnailBG = DrawHelper.CreateLeftRoundRect(1, 1, 50, 49, 1);

        G.FillPath(new SolidBrush(BgColor), BG);
        G.DrawPath(new Pen(BorderColor), BG);

        G.FillPath(new SolidBrush(ThumbnailBGColor), ThumbnailBG);
        G.DrawPath(new Pen(ThumbnailBGColor), ThumbnailBG);

        if (image != null)
        {
            G.DrawImage(image, 3, 3, 48, 47);
        }
        if (Enabled)
        {
            G.DrawString(Text, font.Roboto_Medium10, new SolidBrush(StringColor), new PointF(58.6f, 9f));
        }
        else
        //{ G.DrawString("Wait...", font.Roboto_Medium10, new SolidBrush(StringColor), new PointF(58.6f, 9f)); }
        {
            G.DrawString(Text, font.Roboto_Medium10, new SolidBrush(Color.LightGray), new PointF(58.6f, 9f));
        }

        G.TextRenderingHint = TextRenderingHint.AntiAlias;
        G.DrawString(information, font.Roboto_Regular9, new SolidBrush(ColorTranslator.FromHtml("#999999")), new PointF(59.1f, 26f));
    }