HasK.Controls.Graph.ChartRectObject.DrawStringCenter C# (CSharp) Method

DrawStringCenter() protected method

Draw text on the center of rect object
protected DrawStringCenter ( Graphics g, string text ) : void
g System.Drawing.Graphics Graphics object to draw string
text string Text to draw on object
return void
        protected virtual void DrawStringCenter(Graphics g, string text)
        {
            if (text != null && text != string.Empty)
            {
                var c = Chart.ToScreenPoint(Center);
                var tsz = g.MeasureString(text, Font);
                g.DrawString(text, Font, TextBrush, c.X - tsz.Width / 2, c.Y - tsz.Height / 2);
            }
        }
        /// <summary>