Пример #1
0
        private static Image GetPanelIconBackground(Graphics graphics, Rectangle rectanglePanelIcon, Color backgroundColorBegin, Color backgroundColorEnd)
        {
            Rectangle bounds = rectanglePanelIcon;

            bounds.X = 0;
            bounds.Y = 0;
            Image image = new Bitmap(rectanglePanelIcon.Width, rectanglePanelIcon.Height, graphics);

            using (Graphics graphics2 = Graphics.FromImage(image))
            {
                BasePanel.RenderBackgroundGradient(graphics2, bounds, backgroundColorBegin, backgroundColorEnd, LinearGradientMode.Vertical);
            }
            return(image);
        }
Пример #2
0
 protected override void OnPaintBackground(PaintEventArgs pevent)
 {
     base.OnPaintBackground(pevent);
     if (ShowTransparentBackground)
     {
         BackColor = Color.Transparent;
     }
     else
     {
         Rectangle bounds = base.ClientRectangle;
         if (m_bShowCaptionbar)
         {
             BackColor = Color.Transparent;
             bounds    = new Rectangle(base.ClientRectangle.Left, base.ClientRectangle.Top + base.CaptionHeight, base.ClientRectangle.Width, base.ClientRectangle.Height - base.CaptionHeight);
         }
         BasePanel.RenderBackgroundGradient(pevent.Graphics, bounds, base.PanelColors.PanelContentGradientBegin, base.PanelColors.PanelContentGradientEnd, LinearGradientMode);
     }
 }