/// <summary>Draws a background with a linear gradient still border style.</summary>
        /// <param name="graphics">The graphics to draw on.</param>
        /// <param name="background">The background linear gradient.</param>
        /// <param name="border">The border type.</param>
        /// <param name="rectangle">The coordinates of the rectangle to draw.</param>
        public static void DrawBackground(Graphics graphics, LinearGradientBrush background, Border border, Rectangle rectangle)
        {
            GraphicsPath backgroundPath = VisualBorderRenderer.CreateBorderTypePath(rectangle, border);

            FillBackground(graphics, backgroundPath, background);
            VisualBorderRenderer.DrawBorder(graphics, backgroundPath, border.Color, border.Thickness);
        }
Example #2
0
        /// <summary>Draws the badge.</summary>
        /// <param name="graphics">The graphics to draw on.</param>
        /// <param name="rectangle">The rectangle.</param>
        /// <param name="backColor">The back color.</param>
        /// <param name="text">The text.</param>
        /// <param name="font">The font.</param>
        /// <param name="foreColor">The fore color.</param>
        /// <param name="shape">The shape type.</param>
        /// <param name="textLocation">The _text Location.</param>
        public static void DrawBadge(Graphics graphics, Rectangle rectangle, Color backColor, string text, Font font, Color foreColor, Shape shape, Point textLocation)
        {
            GraphicsPath _badgePath = VisualBorderRenderer.CreateBorderTypePath(rectangle, shape.Rounding, shape.Thickness, shape.Type);

            graphics.FillPath(new SolidBrush(backColor), _badgePath);
            VisualBorderRenderer.DrawBorder(graphics, _badgePath, shape.Color, shape.Thickness);
            graphics.DrawString(text, font, new SolidBrush(foreColor), textLocation);
        }
        /// <summary>Draws a background with a still border style.</summary>
        /// <param name="graphics">The graphics to draw on.</param>
        /// <param name="background">The background color.</param>
        /// <param name="rectangle">The coordinates of the rectangle to draw.</param>
        /// <param name="shape">The shape.</param>
        public static void DrawBackground(Graphics graphics, Color background, Rectangle rectangle, Shape shape)
        {
            GraphicsPath backgroundPath = VisualBorderRenderer.CreateBorderTypePath(rectangle, shape);

            graphics.SetClip(backgroundPath);
            graphics.FillRectangle(new SolidBrush(background), rectangle);
            graphics.ResetClip();
            VisualBorderRenderer.DrawBorder(graphics, backgroundPath, shape.Color, thickness: shape.Thickness);
        }
        /// <summary>Draws a background with a still border style.</summary>
        /// <param name="graphics">The graphics to draw on.</param>
        /// <param name="border">The border type.</param>
        /// <param name="background">The background color.</param>
        /// <param name="rectangle">The coordinates of the rectangle to draw.</param>
        public static void DrawBackground(Graphics graphics, Border border, Color background, Rectangle rectangle)
        {
            GraphicsPath backgroundPath = FillBackgroundPath(graphics, background, rectangle, border);

            VisualBorderRenderer.DrawBorder(graphics, backgroundPath, border.Color, thickness: border.Thickness);
        }