public static _Size MeasureText(string text, Font font) { if (string.IsNullOrEmpty(text)) { return(_Size.Empty); } _Size result = _Size.DefaultFont; using (WindowsGraphics grf = WindowsGraphics.CreateMeasurementWindowsGraphics()) { // WindowsFont wf = WindowsGraphicsCacheManager.GetWindowsFont(font)) result = TextRenderer.MeasureText(grf.DeviceContext, text, font); // WindowsGraphicsCacheManager.MeasurementGraphics.MeasureText(text, wf); return(result); } }
public static _Size MeasureText(_DeviceContext context, string text, Font font) { _Size result = _Size.Empty; return(result); }