AGENT.Contrib.Drawing.Drawing.FindCenter C# (CSharp) Method

FindCenter() public method

Find the center of the screen, for the given text and font
public FindCenter ( string text, Microsoft.SPOT.Font font ) : Point
text string
font Microsoft.SPOT.Font
return Point
        public Point FindCenter(string text, Font font)
        {
            var size = MeasureString(text, font);
            var center = AGENT.Contrib.Device.Center;
            var centerText = size/2 - 2;
            var X = center.X - centerText;
            var Y = center.Y - (font.Height/2);
            return new Point(X, Y);
        }