public void Paint(BidiGraphics g, Rectangle bounds)
            {
                using (g.Container(bounds.X, bounds.Y))
                {
                    g.Graphics.CompositingMode = CompositingMode.SourceOver;
                    g.Graphics.CompositingQuality = CompositingQuality.HighQuality;

                    using (Font boldFont = new Font(_font, FontStyle.Bold))
                    {
                        Rectangle providerNameRect = new Rectangle(_providerNameLeft, 4, _providerNameWidth, _providerNameHeight);

                        if (_image != null)
                            g.DrawImage(false, _image, (int)(providerNameRect.Left - _image.Width - IMAGE_PADDING_RIGHT), (int)(providerNameRect.Top - 1));

                        g.DrawText(_providerName, boldFont, providerNameRect, Color.White, _textFormatFlags);
                    }

                    g.DrawText(_blogName, _font, new Rectangle(PADDING_LEFT, 23, _blogNameWidth, _providerNameHeight), Color.White, _textFormatFlags);
                }

                // This is down here because DrawIcon has a bug (at least with .NET 1.1) where it
                // doesn't respect any translation transforms that have been applied to the Graphics
                // object in GDI+.
                if (_image == null && _icon != null)
                    g.DrawIcon(false, _icon, new Rectangle(bounds.Left + _imageLeft, bounds.Top + 3, IconWidth, IconHeight));
            }
        public void Paint(BidiGraphics g)
        {
            // draw icon
            if ( Image != null )
                g.DrawImage(false, Image, Bounds.X, Bounds.Y) ;
            else if ( Icon != null )
                g.DrawIcon(false, Icon, Bounds.X, Bounds.Y);

            // draw text
            g.DrawText(Caption, _captionFont, new Rectangle(CaptionBounds.X, CaptionBounds.Y, CaptionBounds.Width, CaptionBounds.Height), SystemColors.ControlText, TextFormatFlags.WordEllipsis );
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            BidiGraphics g = new BidiGraphics(e.Graphics, ClientRectangle);
            // draw icon
            if (_domainImage != null)
                g.DrawImage(false, _domainImage, new Rectangle(0, 0, _domainImageSize.Width, _domainImageSize.Height));
            else if (_domainIcon != null)
                g.DrawIcon(false, _domainIcon, new Rectangle(0, 0, _domainImageSize.Width, _domainImageSize.Height));
        }