APG.GDIHelpers.GDIHelper.GetPointForCenterString C# (CSharp) Method

GetPointForCenterString() public static method

public static GetPointForCenterString ( Graphics graphics, Rectangle rectangle, string Message, Font font ) : PointF
graphics System.Drawing.Graphics
rectangle System.Drawing.Rectangle
Message string
font System.Drawing.Font
return System.Drawing.PointF
        public static PointF GetPointForCenterString(Graphics graphics, Rectangle rectangle, string Message, Font font)
        {
            SizeF size = graphics.MeasureString(Message, font);
            return new PointF((rectangle.Width / 2) - (size.Width / 2), (rectangle.Height / 2) - (font.SizeInPoints / 2));
        }

Same methods

GDIHelper::GetPointForCenterString ( Graphics graphics, Rectangle rectangle, string Message, Font font, int margin, string spacer, string &formatedMessage ) : PointF
GDIHelper::GetPointForCenterString ( Graphics graphics, int x, int y, int width, int height, string Message, Font font ) : PointF