Source/NFX.WinForms/Utils.cs
/// <summary>
/// Draws string on the background rectangle
/// </summary>
Draws string on the background rectangle
Draws string on the background rectangle
public static void DrawStringWithBackground(Graphics gr, string text,
                                                Font font,
                                                Brush textBrush,
                                                Brush backBrush,
                                                int x, int y)
    {
      SizeF size = gr.MeasureString(text,font);
      RectangleF rect = new RectangleF(x, y, size.Width, size.Height);
      gr.FillRectangle(backBrush, rect);
      gr.DrawString(text, font, textBrush, x, y);
    }
public static void DrawStringWithBackground ( Graphics gr , string text , Font font , Brush textBrush , Brush backBrush , int x , int y ) { SizeF size = gr . MeasureString ( text , font ) ; RectangleF rect = new RectangleF ( x , y , size . Width , size . Height ) ; gr . FillRectangle ( backBrush , rect ) ; gr . DrawString ( text , font , textBrush , x , y ) ; }
Draws string on the background rectangle
Draws string on the background rectangle
gr
Graphics
text
string
font
Font
textBrush
Brush
backBrush
Brush
x
int
y
int