public override void OnPaint(object sender, RibbonElementPaintEventArgs e)
        {
            base.OnPaint(sender, e);

            Color c = Color.Equals(Color.Transparent) ? Color.White : Color;

            int h = e.Mode == RibbonElementSizeMode.Large ? ImageColorHeight : SmallImageColorHeight;

            Rectangle colorFill = Rectangle.FromLTRB(
                ImageBounds.Left,
                ImageBounds.Bottom - h,
                ImageBounds.Right,
                ImageBounds.Bottom
                );
            SmoothingMode sm = e.Graphics.SmoothingMode;
            e.Graphics.SmoothingMode = SmoothingMode.None;
            using (SolidBrush b = new SolidBrush(c))
            {

                e.Graphics.FillRectangle(b, colorFill);
            }

            if (Color.Equals(Color.Transparent))
            {
                e.Graphics.DrawRectangle(Pens.DimGray, colorFill);
            }

            e.Graphics.SmoothingMode = sm;
        }
        public override void OnPaint(object sender, RibbonElementPaintEventArgs e)
        {
            Owner.Renderer.OnRenderRibbonItem(new RibbonItemRenderEventArgs(
                                                  Owner, e.Graphics, e.Clip, this));

            if (!string.IsNullOrEmpty(Text))
            {
                Owner.Renderer.OnRenderRibbonItemText(new RibbonItemBoundsEventArgs(
                                                          Owner, e.Graphics, e.Clip, this,
                                                          Rectangle.FromLTRB(
                                                              Bounds.Left + Owner.ItemMargin.Left,
                                                              Bounds.Top + Owner.ItemMargin.Top,
                                                              Bounds.Right - Owner.ItemMargin.Right,
                                                              Bounds.Bottom - Owner.ItemMargin.Bottom)));
            }
        }
        public override void OnPaint(object sender, RibbonElementPaintEventArgs e)
        {
            if (DrawBackground)
            {
                Owner.Renderer.OnRenderRibbonItem(new RibbonItemRenderEventArgs(Owner, e.Graphics, e.Clip, this));
            }

            foreach (RibbonItem item in Items)
            {
                item.OnPaint(this, new RibbonElementPaintEventArgs(item.Bounds, e.Graphics, RibbonElementSizeMode.Compact));
            }

            if (DrawBackground)
            {
                Owner.Renderer.OnRenderRibbonItemBorder(new RibbonItemRenderEventArgs(Owner, e.Graphics, e.Clip, this));
            }
        }